Pages: 1
Topic closed
I'm creating an avoider game, and I would like help with a script in which a sprite will randomly fly in and out of the screen.
Help would be much appreciated.
Offline
Could you be more specific please? Is it flying from side to side? Top to bottom? Or a curved path? Is it going at a constant rate? or slowing as it enters and speeding up as it exits? Is it random placement?
Offline
actually i have the same question.. im making it from top to bottom.. and i need help..
thanks
Offline
ive got 3 balls that i want to come down from the top.. i did this to make them pick a random spot to fall from:
[blocks]
<when green flag clicked><set x to( <pick random( -200 )to( 200 )
Offline
when flag clicked, go to border. if touching border, brodcast go to spawn point. when i recieve go to spawn point, pick random 1-5 seconds. repeat until touching border. hope i helped.
Offline
When Green Flag Clicked:
forever {
go to x: (pick random -240 to 240) y: 180.
repeat until <(y position) < -239> {
change y by (NEGATIVE NUMBER HERE). }
}
That will work if you want it to fall on a random x from top to bottom.

Offline
ive got a problem. i can make it work if the -y equals -2... but then the balls fall really slow, and when i try to speed it up i doesnt work anymore. they fall once and dont go back up to the top... help?
thanks,
alden
Offline
aldenhorbach wrote:
ive got a problem. i can make it work if the -y equals -2... but then the balls fall really slow, and when i try to speed it up i doesnt work anymore. they fall once and dont go back up to the top... help?
thanks,
alden
You must have changed another part of the script, if you just changed the -2 to -3 (or another number) then it should do just the same, but fall faster.
Offline
aldenhorbach wrote:
ive got a problem. i can make it work if the -y equals -2... but then the balls fall really slow, and when i try to speed it up i doesnt work anymore. they fall once and dont go back up to the top... help?
thanks,
alden
Are you sure you got the script completely right? Maybe you used = instead of < ...

Offline
Topic closed
Pages: 1