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

#1 2010-10-14 15:35:58

fireballman
Scratcher
Registered: 2010-02-17
Posts: 14

Help with infinite scrolling

How do I make an infinite scroller so that sprites randomly appear every so often?


There are only 10 types of people in the world: Those who know binary and those who don't.

Offline

 

#2 2010-10-15 03:08:09

2l84zwamani
Scratcher
Registered: 2010-09-27
Posts: 100+

Re: Help with infinite scrolling

I don't know what you mean about infinite scroller, but you can use

<when green flag clicked>
<forever>
<show>
<wait( <pick random( blah )to( blah )secsc>


I will be a Ms. Pickle Dr. Deadpebble Great Person <forever>
http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3http://is.gd/d55N3 GROB THE SLIME WILL TAKE OVER THE WORLD!

Offline

 

#3 2010-10-15 09:36:39

ShockTheHedgehog
Scratcher
Registered: 2010-02-12
Posts: 25

Re: Help with infinite scrolling

this is what I did

http://scratch.mit.edu/projects/ShockTheHedgehog/1288143

you can use this if you want, yet making an object appear every so often would mean that you would need to be able to find a way to make the object that appears know what position to appear at


I am, was and ever shall be epic, but you fail, oh, and you just lost the game
http://www.wizards.com/magic/images/whatcolor_isblack.jpgTake the Magic: The Gathering 'What Color Are You?' Quiz.

Offline

 

#4 2010-10-17 10:47:58

fireballman
Scratcher
Registered: 2010-02-17
Posts: 14

Re: Help with infinite scrolling

Sorry, my explaining wasn't very good. What I mean is make sprite 'enemies' appear on an infinite scrolling base, without them disappearing while they're on screen, only once they have reached the edge.


There are only 10 types of people in the world: Those who know binary and those who don't.

Offline

 

#5 2010-10-17 11:21:51

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Help with infinite scrolling

If abs of X position over about 250
hide
else
show

Offline

 

#6 2010-10-17 14:59:43

fireballman
Scratcher
Registered: 2010-02-17
Posts: 14

Re: Help with infinite scrolling

Erm, I now have a different problem, caused by solving another problem.
As you can't draw pen on sprites, i've had to use the stage as the background, and have the 'enemies' scroll (y) instead of a scrolling background.
How do I make an 'enemy' sprite appear at the top the screen at a random time, then scroll down using scrolly and diasappear again at the bottom?
If I just use (wait (pick random)), the sprites usually don't appear at the top of the screen when I use scrolly+360*scrollno.

Last edited by fireballman (2010-10-17 15:01:33)


There are only 10 types of people in the world: Those who know binary and those who don't.

Offline

 

#7 2010-10-17 15:33:44

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Help with infinite scrolling

You will need to set a variable of the scroll Y when it first appears then use that instead of scroll no * 360

Last edited by colorfusion (2010-10-17 15:34:05)

Offline

 

Board footer