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

#1 2011-10-28 21:21:58

aldenhorbach
New Scratcher
Registered: 2011-09-22
Posts: 23

scrolling?

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

 

#2 2011-10-28 21:29:54

superepic1
Scratcher
Registered: 2011-08-18
Posts: 20

Re: scrolling?

[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

 

#3 2011-10-29 09:13:31

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: scrolling?

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!


Why

Offline

 

Board footer