I can scroll on my background, but I can't test it becasue the computer goes all glitchy when I press ther green flag! is there any other ways to scroll? This is my way:
When Green flag clicked
Forever
{if X postion is MORE than 480
set X postion to -480
{if x postion is LESS then -480
set X postion to 480
Same goes with y except the numbers are 360 and -360
Then you can just do the change X,Y thingy for the motion.
It has an infinate sized background as a result.
A trick I want to reveal is this, when you are making a background, eg-grass, make on simple grass blade in detail, then make another behind it, facing the other direction. Then select the grass blade/s, and while HOLDING on control-C, move the grass blades around the screen. The grass blades will paste onto the screen rapidly, so you can make grass looking backgrounds in a flash.
Offline
You don't want a forever loop that keeps checking position.
Try
[blocks]
<when green flag clicked>
<forever if> <x position> <>> 480
<set x to( -480
<end>
<when green flag clicked>
<forever if> <x position> <<> -480
<set x to( 480
<end>
[/blocks]
The [blocks]<forever if>[/blocks] is misleadingly named---it is really
[blocks]
<forever>
<wait until>
[/blocks]
which avoids the busy waiting.
Last edited by kevin_karplus (2007-08-17 17:30:30)
Offline
Heres a script you can try script
when flag clicked
forever if abs(x position)> 480
if x position >0
set x postion to -480
else
set x position to 480
Offline
i have a forum that discusses it on the sticky part of this it is called "what are you working on."
you can get alot of ideas there and post new ones
Last edited by YAYALEC (2007-08-18 06:53:00)
Offline
Here is a background that scrolls in two dimensions.
Gaaaah! Putting in blocks takes forever. I'm uploading the project I'm working on right now, then you can download it and steal the code.
http://scratch.mit.edu/projects/AlveKatt/30058
Edit: Oh god it's slow and laggy! Don't use this solution, it sucks...
Last edited by AlveKatt (2007-08-18 08:12:32)
Offline
My way works (possibly, but I can't test it out), but everyone thinks that I can't do it at all, It is not the blocks fault that the computer goes glitchy, I might just need a new way to do it. Possibly I can see a project that has a way different to mine. Then I can download it.
Offline
<when green flag clicked>A game with my relatively simple method of running smooth continuous 1 directional scroling can be foud here:
http://scratch.mit.edu/projects/Mayhem/19961
It uses two identical sprites with a tiling background of clouds.
Sprite 1:
[blocks]
<when green flag clicked>
<go to x -225 )y 0
<forever>
<if><( <x position> <<> -450 )>
<go to x 450 )y 0
<go back( 20 )layers>
<else>
<change x by( -5
[/blocks]
Sprite 2 is the same except that its start position is X: 225 Y:0
However, it is possible for these sprites to get out of synch, so a control method using a pair of related variables as X values might be better
Last edited by Mayhem (2007-08-20 16:17:06)
Offline
If you need new ideas, look here, http://scratch.mit.edu/projects/Llamalover/30120
Offline