Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Prev Previous Post   Next Post Next
random objects in an if/else
Posts: n/a
Smile random objects in an if/else - 04-09-2010, 04:34 AM

I have a question about selecting a random object from a list and using the object selected in an if/else.

More specifically, I am working on a game of wack-a-mole (with hares instead of moles) and I want to make an if/else statement that asks "if the random hare selected is below ground, move the same random object selected up .5 meters. Else, do nothing.

Hopefully the end result will be Alice selecting a hare at random and moving its head above the ground if it it currently below it, and then go back down when you click on it.

Currently, i have it set up so that a specific object chosen by me (hare1, hare2, ect.) goes up the height of its head and gives the player 3 seconds to click it. after the 3 seconds are up, it checks whether it is above or below ground (If the player clicked it, it should be below ground). If it is below ground, it makes the next one go up. If it is above ground (meaning the player hasn't clicked it), it goes down on its own and the next one goes up.

thanks in advance.
Attached Files
File Type: a2w wackamole.a2w (1.44 MB, 16 views)
Reply With Quote

if/else, random, wack-a-mole

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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.