That's a nice scrolling system, so far As for your problem, try something like this on 1 inside the x part of "go to x: () y: ()"...
(0 - (ScrollX) )
And on 2...
(0 - ( (ScrollX) - (480) ) )
Hope this helps
Offline
Whoops! ^^ I'm not too good with forever scrolling... I'll see if I can find anything that's of use for you
Offline
Does this help? You could adjust how the background makes the list change (eg, change it to using arrow keys, not automatic scrolling)
http://scratch.mit.edu/projects/teammcb/421895
Offline
here is my working fix
in Sprite4 (the ball) I changed 2 things...
<if> <key[ right arrow ]pressed?>
<change{ Scrollx }by( 1
<if> <{ Scrollx }> <( <>> )> 480
<set{ Scrollx }to( -480
<end>
<turn ccw( 360-(25*3.1415926 )degrees>
<end>
and
<if> <key[ left arrow ]pressed?>
<change{ Scrollx }by( -1
<if> <{ Scrollx }> <( <<> )> -480
<set{ Scrollx }to( 480
<end>
<turn cw( 360-(25*3.1415926 )degrees>
<end>
then in sprite 1...
<when green flag clicked>
<forever>
<go to[ x: Scrollx y: 0
and lastly in sprite 2...
<when green flag clicked>
<if> <( Scrollx <<> 0 )>
<go to[ (( Scrollx <+> 480 ))
<else>
<go to[ (( Scrollx <-> 480 ))
Last edited by Locomule (2010-06-18 13:25:59)
Offline
use method 2 then everything will be perfect http://scratch.mit.edu/forums/viewtopic.php?id=2440
Last edited by archmage (2010-06-18 16:02:31)
Offline
It worked perfectly for me or I wouldn't have posted it. Maybe something got typed wrong, anyway I uploaded the fixed version here...
http://scratch.mit.edu/projects/Locomule/1138457
Here are some observations btw. Notice how the sprites get stuck momentarily as they are just about to move off the stage? Scratch defaults to keeping the last 18 pixels of a sprite visible until it 'jumps' the sprite away. I had a lot of luck with using an outside graphic editor to make an 18 pixel-wide transparent square around my sprites so they would move smoothly off the screen.
Also, you can get an annoying flicker around the edges of the stage. My true scratchx type scrolling projects all include a border sprite that stays above all the other sprites and hides this. Sometimes I color it or sometimes I just use a black border to blend in with the normal black border in presentation mode.
Happy Scratching >=P
Last edited by Locomule (2010-06-20 10:50:30)
Offline
Locomule wrote:
It worked perfectly for me or I wouldn't have posted it. Maybe something got typed wrong, anyway I uploaded the fixed version here...
http://scratch.mit.edu/projects/Locomule/1138457
Here are some observations btw. Notice how the sprites get stuck momentarily as they are just about to move off the stage? Scratch defaults to keeping the last 18 pixels of a sprite visible until it 'jumps' the sprite away. I had a lot of luck with using an outside graphic editor to make an 18 pixel-wide transparent square around my sprites so they would move smoothly off the screen.
Also, you can get an annoying flicker around the edges of the stage. My true scratchx type scrolling projects all include a border sprite that stays above all the other sprites and hides this. Sometimes I color it or sometimes I just use a black border to blend in with the normal black border in presentation mode.
Happy Scratching >=P
Yeah - I think your method is the only way to get your sprites to move off the screen well enough, aside from the method of hiding the sprites after they've moved "off" the screen.
Happy to see you're having success!
Offline
Thanks a lot! I've been working on learning to code different routines from games I grew up on (I'm 38) while accumulating ideas for finished games. I started out doing this stuff in 1983, this is much easier
Offline