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

#1 2008-06-03 12:40:34

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

New Scrolling Explained

Well, I know no one really cares about it, but I'd figure I'd explain it. First, go to Archmages thread, and learn method 1. Now, add this to the stage, and add variable finder.

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<if><( <{ ScrollX }> <<> 1 )>[/blocks]
[blocks]<set{ Finder }to( <round( (( (( <abs( <{ ScrollX }> </> 1000 )) <*> 2 ))[/blocks]
[blocks]<else>[/blocks]
[blocks]<if><( <{ ScrollX }> <>> 1 )>[/blocks]
[blocks]<set{ Finder }to( <round( (( (( <abs( <{ ScrollX }> </> 1000 )) <*> -2 ))[/blocks]
[blocks]<end>[/blocks]


Now the If block in the else block isn't really necessary, but Ilike it so it won't do it whenever.
Now, make 3 terrain sprites, and name the first one Main X. Put in this script:

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> (( 480 <*> <{ Finder }> )) ))[/blocks]

Now for This one, name it Negative X, and put this in it:

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> (( 480 <*> (( <{ Finder }> <-> 1 )) )) ))[/blocks]

And finally, the last one, name it Positive X, and this goes in it:

[blocks]<when green flag clicked>[/blocks]
[blocks]<forever>[/blocks]
[blocks]<set x to( (( <{ ScrollX }> <+> (( 480 <*> (( <{ Finder }> <+> 1 )) )) ))[/blocks]


Alright, there it is. You can also add more sprites, like Negative X2, where you change the minus one to a minus two, because as you go further, the longer it takes to change finder.

Offline

 

#2 2008-06-03 14:01:47

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: New Scrolling Explained

actually this has been done before, quite a few times, my games Lunar traveler and super mario bros. use this, but this is demonstrated correctly, Lunar traveler also uses a Y scroll in this format too, this type of scrolling can also be defined as unlimited scrolling


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#3 2008-06-03 14:03:08

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

Re: New Scrolling Explained

dingdong wrote:

actually this has been done before, quite a few times, my games Lunar traveler and super mario bros. use this, but this is demonstrated correctly, Lunar traveler also uses a Y scroll in this format too, this type of scrolling can also be defined as unlimited scrolling

Using those scripts?

Offline

 

#4 2008-06-03 14:03:58

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: New Scrolling Explained

oh wait this is different, what does it exactly do?


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#5 2008-06-03 14:09:18

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

Re: New Scrolling Explained

dingdong wrote:

oh wait this is different, what does it exactly do?

Ya, yours uses Archamges. Alright, I've never really hought how it works, but I'll try.

Since ScrollX is negative, and we want a positive number when it's negative, I used the ABS block (obviously). I dividde by a big number to get Finder into a small decimal, and multiply by 2 to get it into a bigger decimal, big enough to round up.

I don't really get how it works, but all I know is it does.

Offline

 

#6 2008-06-03 14:14:06

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: New Scrolling Explained

this isn't what I used, but as long as it works it's fine


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

#7 2008-06-03 14:15:04

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

Re: New Scrolling Explained

dingdong wrote:

this isn't what I used, but as long as it works it's fine

If you click my name, all my scrollers (I think) use this, and they are good, with no glitches in the scrolling

Offline

 

#8 2008-06-03 20:31:23

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

Re: New Scrolling Explained

And also note: this is for VERY SIMPLE background sprites, like a space scene, otherwise it kinda looks weird.

Offline

 

Board footer