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

#1 2010-05-23 01:29:33

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

How do I make Y scrolling terrain with only one sprite?

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!


-End Transmission-

Offline

 

#2 2010-05-23 03:04:26

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

bump!


-End Transmission-

Offline

 

#3 2010-05-23 04:16:37

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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).


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#4 2010-05-23 04:43:07

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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...


-End Transmission-

Offline

 

#5 2010-05-23 06:50:46

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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...  smile
...
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


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#6 2010-05-23 07:17:17

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: How do I make Y scrolling terrain with only one sprite?

It is possible, with a thing of stamping. I'm currently making a 1s1s scrolling platformer like LINE.

Offline

 

#7 2010-05-23 07:41:12

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: How do I make Y scrolling terrain with only one sprite?

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...


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#8 2010-05-23 07:49:34

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

One sprite? Look at slime maze: http://scratch.mit.edu/projects/juststickman/818653


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#9 2010-05-23 07:50:35

Dazachi
Retired Community Moderator
Registered: 2009-09-12
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

You could try downloading the project you mentioned.


Dazachi, Retired Community Moderator
May also know me as OJACheung.

Offline

 

#10 2010-05-23 16:30:50

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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?


-End Transmission-

Offline

 

#11 2010-05-23 16:46:31

wildplayer
Scratcher
Registered: 2008-08-01
Posts: 100+

Re: How do I make Y scrolling terrain with only one sprite?

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

 

#12 2010-05-24 00:57:04

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

bump!


-End Transmission-

Offline

 

#13 2010-05-24 02:38:07

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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.  smile
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.

hmm


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#14 2010-05-24 04:06:57

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

I still need help! Someone help me, please!


-End Transmission-

Offline

 

#15 2010-06-30 17:35:35

qwertypower
Scratcher
Registered: 2010-02-24
Posts: 100+

Re: How do I make Y scrolling terrain with only one sprite?

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...  smile
...
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.


http://img690.imageshack.us/img690/8586/x1eo8x.png  http://img690.imageshack.us/img690/9164/logozrv.png
http://img693.imageshack.us/img693/8186/image843.png      http://img411.imageshack.us/img411/406/bobs.png      http://img535.imageshack.us/img535/2898/firegrob.png     Add zip the cybug, bob the sea urchin, and firegrob to your sig!

Offline

 

#16 2010-07-30 07:48:24

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: How do I make Y scrolling terrain with only one sprite?

I think I might be able to help. Let me just quickly make one...


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#17 2010-07-30 08:03:21

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: How do I make Y scrolling terrain with only one sprite?

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 sad  0 )y sad  (( <{ 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)


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#18 2010-07-30 16:50:55

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: How do I make Y scrolling terrain with only one sprite?

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 x sad  0 )y sad  (( <{ 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!  big_smile


-End Transmission-

Offline

 

#19 2010-07-30 16:57:38

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: How do I make Y scrolling terrain with only one sprite?

Welcome!  big_smile


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&amp;online=http://lemonfanatic.webs.com/ONLINE.png&amp;offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

Board footer