The idea here is simple, I want to be able to have falling objects, I've got some of it working, I can get one to fall and then go back to the top of the screen, but it's not very smooth. Also I would like to have the objects set for a random falling interval, so that they don't come out at a consistent time frame. Ideas?
Offline
Okay so I got them to cycle jut fine, any ideas of randomness?
Offline
the
pickrandom[10] to [20]block
Offline
And that is in seconds?
Offline
go to x: (pick random [-240] to [240]) y: [180] glide (pick random [3] to [5]) secs to x: (x position) y: [-180]
Last edited by RedRocker227 (2012-02-09 03:08:21)
Offline
The CS instructor addressed this at some point. You have to use a forever loop to get the objects to appear at random locations on the "x" axis at a fixed location in the "y" axis, then gradually decrease their "y" value (their distance to the ground).
Use the "pick random" module in the Operators section for the place of the x value (of course you have to set the range of the x-plane where the object appears
goto x: (pick random [-100 to 100]) y: [150] when gf clicked forever change y by [-1]
Offline
egrizzly wrote:
The CS instructor addressed this at some point. You have to use a forever loop to get the objects to appear at random locations on the "x" axis at a fixed location in the "y" axis, then gradually decrease their "y" value (their distance to the ground).
I corrected the scratch blocks graphics. my bad.when gf clicked goto x: (pick random [-100 to 100]) y: [150] forever change y by [-1]
Offline
egrizzly wrote:
egrizzly wrote:
The CS instructor addressed this at some point. You have to use a forever loop to get the objects to appear at random locations on the "x" axis at a fixed location in the "y" axis, then gradually decrease their "y" value (their distance to the ground).
I corrected the scratch blocks graphics. my bad.when gf clicked goto x: (pick random [-100 to 100]) y: [150] forever change y by [-1]
by the way...you have to do this for each falling object. To set the falling interval just use the "wait x seconds" after the "change y by -1" statement to vary the timing of the fall between the sprites/objects. You have to change the # of seconds in each "wait../." statement for each sprite/object.
Offline