hey i was wanting to make a scrolling game, and i cant remember where the video tutorials are... do any of you guys know?
Offline
[blocks] Go to scratch and watch scrollingdemo. Its in the examples folder on your computer
remember kidz always start with when green flag clicked
Last edited by superepic1 (2011-10-28 21:30:33)
Offline
Make a variable called 'scrollx'. Now put this script on the player:
When green flag clicked
Forever
If key left arrow pressed
Change scrollx by 5
End if
If key right arrow pressed
Change scrollx by -5
End if
End forever
Now make 3 terrains the width of the stage, and label them terrain0, terrain1 and terrain2. You can make more, but 3 is a good way to start. Make sure you name the first terrain 'terrain0' not terrain1' (an easy mistake to make). Now put this script on each of the terrains:
When green flag clicked
Forever go to x: scrollx+(480x0) y:0
If abs of x position > 460
Hide
Else
Show
End forever
You see the go to x: y: part of the script? Inside the brackets, change the 0 to the number after the terrain in the sprite name. So for the sprite 'terrain2', you would put:
Go to x: scrollx+(480x2)
Hope I helped!
Offline