PDA

View Full Version : Random Jumping Objects


chellydee
07-24-2016, 09:17 PM
I'm working on an Alice World, where my objects need to jump at a random height. I figured out how to make objects go up with random in the method, but I can't figure out how to make the object come back down the same exact height randomly chose.
Please help

chickentree
07-25-2016, 12:52 AM
I'm working on an Alice World, where my objects need to jump at a random height. I figured out how to make objects go up with random in the method, but I can't figure out how to make the object come back down the same exact height randomly chose.
Please help

My suggestion would be to write a jump method that takes a numeric parameter and uses it to jump up and down.
Then in your "my fist method" create a loop. Each time you go through the loop:
1. Generate a new random number.
2. Call your jump method using the new random number.

Mark

chellydee
07-31-2016, 12:44 PM
My suggestion would be to write a jump method that takes a numeric parameter and uses it to jump up and down.
Then in your "my fist method" create a loop. Each time you go through the loop:
1. Generate a new random number.
2. Call your jump method using the new random number.

Mark

Thanks...that helped a lot.