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

#1 2010-04-22 16:55:57

spanishmonkey246
Scratcher
Registered: 2010-03-16
Posts: 2

Scroll-x and Scroll-y!

Please help me with scroll-x.  All I want to know is the scripts.  Please help again!

Offline

 

#2 2010-04-22 17:44:08

12three
Scratcher
Registered: 2008-06-12
Posts: 1000+

Re: Scroll-x and Scroll-y!

This is a link to a project about ScrollX. Hope it helps!
http://scratch.mit.edu/projects/yambanshee/263478

Offline

 

#3 2010-05-01 03:58:55

Jakelsm
Scratcher
Registered: 2008-01-01
Posts: 4

Re: Scroll-x and Scroll-y!

I know how to make a ENDLESS scroller!

Make a variable called <{ scrollx }>

Now you make a terrain, and put a script on it
<when green flag clicked>
<forever>
<set x to( ((<{ scrollx }>  <+>((460  <*> 0 ))  ))
<end>
The number of the script depends of the terrain you have.
<when green flag clicked>
<forever>
<if><abs( <x position><( <>>460  )>
<if>
<hide>
<else>
<show>
<end>

Now for the background:

<when green flag clicked>
<forever if><( <{ scrollx }> <<> -915  )>
<set{ scrollx }to( -120
<end>

<when green flag clicked>
<forever if><( <{ scrollx }> <>> -10 )>
<set{ scrollx }to( -900
<end>

<when green flag clicked>
<forever if><key[ right arrow ]pressed?>
<change{ scrollx }by( 5
<end>

<when green flag clicked>
<forever if><key[ left arrow ]pressed?>
<change{ scrollx }by( -5
<end>

And that's it!

Offline

 

Board footer