This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-14 10:38:17

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Infinite 4-Way Scrolling

For a hot air ballooning project I'm making, I need to use infinite 4-way scrolling, but it stops at the bottom, which has a grass base. I can try to do it myself, but I've never really gotten infinite scrolling to work very well for me, and that was only X-scrolling, plus the grass base might complicate things a bit. What would be the best way to do this? I know I will need at least four sprites for the sky and two sprites for the ground.


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2 2012-04-14 12:21:34

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Infinite 4-Way Scrolling

This should be in the "Help with Scripts" forum.  Infinite scrolling requires a good amount of work and a knowledge of what a "mod" block does...although you can do infinite scrolling without it...it's much easier with.  The script I usually use for a single sprite to do 4-way scrolling is:

go to x: (((scrollx) mod (960)) - (480)) y: (((scrolly) mod (720)) - (360))
stamp
go to x: ((((scrollx) + (480)) mod (960)) - (480)) y: (((scrolly) mod (720)) - (360))
stamp
go to x: ((((scrollx) + (480)) mod (960)) - (480)) y: ((((scrolly) + (360)) mod (720)) - (360))
stamp
go to x: (((scrollx) mod (960)) - (480)) y: ((((scrolly) + (360)) mod (720)) - (360))
stamp
If you have multiple costumes, that requires some additional math for the costume number you want.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2012-04-18 16:57:42

tomthenoob
New Scratcher
Registered: 2012-04-03
Posts: 5

Re: Infinite 4-Way Scrolling

i just started scratch, but have no idea how the scrollx variable works, can someone foreward me a tutorial or something?

Offline

 

#4 2012-04-18 17:46:57

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Infinite 4-Way Scrolling

tomthenoob wrote:

i just started scratch, but have no idea how the scrollx variable works, can someone foreward me a tutorial or something?

scrollx is just simply a variable...it's a number you can edit, but unlike positions, effects, sizes and such, it doesn't affect anything directly until you make it...such as setting the x position to a variable.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#5 2012-04-18 18:57:15

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Infinite 4-Way Scrolling

tomthenoob wrote:

i just started scratch, but have no idea how the scrollx variable works, can someone foreward me a tutorial or something?

Wiki to the rescue  big_smile


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer