Pages: 1
Topic closed
I can't have a trillion sprites, so how do I make scrolling terrain with only one sprite?
It should be Y scrolling only.
I know it's possible because 08jackt used only one sprite in his Radar games for the ground.
Help!
Offline
You know those infinite scrolling demos?
Instead of x, make it set y to something, and a +360 instead of 480.
Or you could use the cheap way (when you go up, sprites actually go down and when they reach the bottom they go to the top again with a different animation frame).
Offline
juststickman wrote:
You know those infinite scrolling demos?
Instead of x, make it set y to something, and a +360 instead of 480.
Or you could use the cheap way (when you go up, sprites actually go down and when they reach the bottom they go to the top again with a different animation frame).
The thing is, it all has to be in one sprite...
Offline
iCode-747 wrote:
juststickman wrote:
You know those infinite scrolling demos?
Instead of x, make it set y to something, and a +360 instead of 480.
Or you could use the cheap way (when you go up, sprites actually go down and when they reach the bottom they go to the top again with a different animation frame).The thing is, it all has to be in one sprite...
Scrolling is impossible with one sprite - you need at least two, so the sprites can move and still cover the whole screen.
Do just as you do with X scrolling, but change the X to Y and change the 480's to 360's. You could download this and do that...
...
Okay, I went to archmage's two-sprite X scrolling thing, and got two sprites from it - one contains the scripts for two-sprite X scrolling, and the other contains the scripts for two-sprite Y scrolling. You can download them - there are comments that tell you where to put the scripts.
Two-sprite X Scrolling
Two-sprite Y Scrolling
Offline
iCode-747 wrote:
juststickman wrote:
You know those infinite scrolling demos?
Instead of x, make it set y to something, and a +360 instead of 480.
Or you could use the cheap way (when you go up, sprites actually go down and when they reach the bottom they go to the top again with a different animation frame).The thing is, it all has to be in one sprite...
fg123 made a 1s1s scroller/platformer...
Offline
One sprite? Look at slime maze: http://scratch.mit.edu/projects/juststickman/818653
Offline
It didn't work. What script should I use to move the background?
I changed the ScrollY variable, but it didn't move. Do I somehow have to change the other one?
Offline
make a sprite set its size to 200% or change it by whatever. Or if you want it a lot longer, make it at a 90 degree angle (make the maze horizontal and have it change its direction to up ,0 degrees) then use the stretch block; you can get this from my stretchy goo (set the stretch to something %), this requires you to cram the sprite in the editor. If you want the project to not look like a remix export the sprite. Then change the y by #/-# depending on direction.
Offline
laser100 wrote:
It is possible, with a thing of stamping. I'm currently making a 1s1s scrolling platformer like LINE.
I'm talking about traditional scrolling - where you move terrain sprites around. 1 sprite scrolling uses the pen, has problems (ie. you constantly have to clear, you can see the stamping unless you're in presentation mode), and won't work well in most situations.
iCode-747 wrote:
It didn't work. What script should I use to move the background?
I changed the ScrollY variable, but it didn't move. Do I somehow have to change the other one?
The sprites come with comments... anyway, do this:
• Make two terrain sprites, each with a few costumes
• Put the scripts into their places (see the comments attached to the scripts)
• Implement a way of changing the Scroll Y variable (just keep it simple for now)
• Delete the imported sprite
• Click the green flag! It should work.
Well, it doesn't work - I tried it, and it didn't work - even though archmage's project with exactly the same scripts worked! The only difference between them is that the variable names are different, and the costumes are different - both of those things should have no impact.
Offline
Jonathanpb wrote:
iCode-747 wrote:
juststickman wrote:
You know those infinite scrolling demos?
Instead of x, make it set y to something, and a +360 instead of 480.
Or you could use the cheap way (when you go up, sprites actually go down and when they reach the bottom they go to the top again with a different animation frame).The thing is, it all has to be in one sprite...
Scrolling is impossible with one sprite - you need at least two, so the sprites can move and still cover the whole screen.
Do just as you do with X scrolling, but change the X to Y and change the 480's to 360's. You could download this and do that...![]()
...
Okay, I went to archmage's two-sprite X scrolling thing, and got two sprites from it - one contains the scripts for two-sprite X scrolling, and the other contains the scripts for two-sprite Y scrolling. You can download them - there are comments that tell you where to put the scripts.
Two-sprite X Scrolling
Two-sprite Y Scrolling
It is possible. You just do grab screen region for new sprite. And then you make it move.
Offline
Put the scrolling terrains in different costumes, lowest to highest. Script 1 [blocks]<when green flag clicked>
<set{ scrollY }to( 0
<forever>
<next costume>
<go to x 0 )y
(( <{ scrollY }> <+> (( 360 <*> (( <{ costume# }> <-> 1 )) )) ))
<end>
[/blocks]
Script 2
[blocks]
<when green flag clicked>
<forever>
<if><key[ up arrow ]pressed?>
<if><< <not> <( <{ scrollY }> <=> (( (( amount of terrains <-> 1 )) <*> -360 )) )> >>
<change{ scrollY }by( -1
<end>
<if><key[ down arrow ]pressed?>
<if><< <not> <( <{ scrollY }> <=> 0 )> >>
<change{ scrollY }by( 1
<end>
<end>
[/blocks]
Last edited by HD123 (2010-07-30 08:31:33)
Offline
HD123 wrote:
Put the scrolling terrains in different costumes, lowest to highest. Script 1 [blocks]<when green flag clicked>
<set{ scrollY }to( 0
<forever>
<next costume>
<go to x0 )y
(( <{ scrollY }> <+> (( 360 <*> (( <{ costume# }> <-> 1 )) )) ))
<end>
[/blocks]
Script 2
[blocks]
<when green flag clicked>
<forever>
<if><key[ up arrow ]pressed?>
<if><< <not> <( <{ scrollY }> <=> (( (( amount of terrains <-> 1 )) <*> -360 )) )> >>
<change{ scrollY }by( -1
<end>
<if><key[ down arrow ]pressed?>
<if><< <not> <( <{ scrollY }> <=> 0 )> >>
<change{ scrollY }by( 1
<end>
<end>
[/blocks]
Thanks!
Offline
Topic closed
Pages: 1