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

#1 2011-05-05 12:29:24

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

How do I scroll?

So I am making this project http://scratch.mit.edu/projects/rabbit1131/1763732 without the terrain generator so it can scroll. But my problem is, I haven't the slightest Idea how! Help would be much appreciated!


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

#2 2011-05-05 12:40:08

cowman2
Scratcher
Registered: 2011-01-20
Posts: 4

Re: How do I scroll?

make individual sprites for the terrain and make a script for each
<when green flag clicked>
<forever>
<go to x sad  (( <{ scroll x }>  <+> 462 times number of terrains before the sprite )) )y sad  0
<if><(  <x position> <=> 462 or -462 )>
<hide>

put this script in every terrain sprite. Then make a script like this to make the player move the scroll terrain.

<when green flag clicked>
<forever>
<if><key[ right arrow ]pressed?>
<change{ scroll }by( -3
<if><key[ left arrow ]pressed?>
<change{ scroll }by( 3

that makes the sprite terrain scroll in the right order when the left and right arrow keys are pressed.

Hope this helped.
If you don't understand or need anymore help then tell me and i'll try to help some more.

Offline

 

#3 2011-05-05 13:05:21

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: How do I scroll?

cowman2 wrote:

make individual sprites for the terrain and make a script for each
<when green flag clicked>
<forever>
<go to x sad  (( <{ scroll x }>  <+> 462 times number of terrains before the sprite )) )y sad  0
<if><(  <x position> <=> 462 or -462 )>
<hide>

put this script in every terrain sprite. Then make a script like this to make the player move the scroll terrain.

<when green flag clicked>
<forever>
<if><key[ right arrow ]pressed?>
<change{ scroll }by( -3
<if><key[ left arrow ]pressed?>
<change{ scroll }by( 3

that makes the sprite terrain scroll in the right order when the left and right arrow keys are pressed.

Hope this helped.
If you don't understand or need anymore help then tell me and i'll try to help some more.

I'll try that! Thanks much  smile


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

Board footer