Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Random Jumping
Old
kindOfLost
Guest
 
Status:
Posts: n/a
Default Random Jumping - 05-03-2009, 05:37 PM

Ok so I am trying to get these three kangaroos to randomly jump up and down. And I thought that I had it but when it starts they just keep going up or down. Please advise
   
Reply With Quote
Old
RockyTheConcreteDonkey
Guest
 
Status:
Posts: n/a
Default 05-04-2009, 05:57 PM

Quote:
Originally Posted by kindOfLost View Post
Ok so I am trying to get these three kangaroos to randomly jump up and down. And I thought that I had it but when it starts they just keep going up or down. Please advise
Ive never tried random actions before but I have the same prob with random lightning strikes... The most I cold get was from curtain events
   
Reply With Quote
Old
reddStarr
Guest
 
Status:
Posts: n/a
Default 05-04-2009, 08:24 PM

Do you want the to keep jumping up and down, or jump at random times?


KEEP JUMPING COUNTINUESLY
use a loop,


RANDOM TIMES
Use a if else on the bottom next to the Do Togethers. Then go to functions in that tab of actions and make sure you are on world and nothing else. No scroll on the function list until you see the section random. No drag the probility of true to the part were it says true in the If else. Now select that percentage of times they will jump up. Make sure the If/Elseis open now, and under If, put what will happen if they were to jump and under else put what will happen if they don't jump, after it goes through either else or if it'll continue through the method.
   
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-04-2009, 09:23 PM

Creating and manipulating random number's is a breeze in Alice. There are two premade methods to do this!

I attached a demo that should explain this to you, please don't just use this for your class, but try to understand what is going on.

I have a global variable being set to the value passed from the random method.

Then i have a series of conditional statements, based on what my global variable is I have different kangaroo's jump.
Attached Files
File Type: a2w randomRoo's.a2w (1.26 MB, 24 views)
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.