Alice Community  

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

Reply
 
Thread Tools Display Modes
Wac-A-Mole help! please
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default Wac-A-Mole help! please - 04-05-2011, 11:30 AM

My friend is trying to make a Wac-A-Mole game but we cant figure out how to make a random mole pop up...can anyone help?
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 04-05-2011, 11:54 AM

Have you tried using the random number function in the world's function's tab? If so, do you need help implementing it?


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
Reply With Quote
Old
Lordelwood
Senior Member
 
Lordelwood's Avatar
 
Status: Offline
Posts: 43
Join Date: Oct 2010
Default 04-05-2011, 02:49 PM

i have an idea, and it can be done two different ways.
1) if you want to use only one mole, you could move the mole to each spot where it will pop up from and place a dummy object,. go ahead and rename these so you don't lose them among other possible dummy objects. then go to the properties tab in the whack-a-mole machine and create new variable. select object, the check "make a[list]". now you can add all the dummy object into the list and name it mole spawn or something. then for your code, once the mole goes down, (for style you can turn it invisible)... move to, expressions i believe, then mole spawn, random. then you can have it move up, dance whatever you want, that way it will move to different spawn points randomly

2) basically the same idea but having a mole in each hole and using toes for your list instead of the dummy objects. than tell it to move (mole1) up, but drag in your list and choose the random mole. the only problem with this is to tell it which mole to move back down. my only thoughts on this would be to give each mole a variable and when it moves up it turn the value to 1, then have something like [for all together] if mole up value =1 - mole move down type of thing...

hope this helps. if you need me to clarify anything just let me know, or if you run into any problems
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default 04-05-2011, 06:49 PM

When using Option 2, you can create a numeric variable, put a randomly generated value in it, and then use it to access any mole in the list.

I think it's been discussed many times in the past.
   
Reply With Quote
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default 04-06-2011, 11:23 AM

Quote:
Originally Posted by reuben2011 View Post
Have you tried using the random number function in the world's function's tab? If so, do you need help implementing it?
i just need to know where the "random number" goes...if u can, can u show me an example of it?
   
Reply With Quote
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default 04-06-2011, 03:30 PM

Just add a method for a mole to move up and then make an object variable with the list of moles in it. Then, drag the variable into the object name for the move up method, and choose "random item from list" or something like that. Then loop the method and they will randomly pop up.
   
Reply With Quote
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default 04-07-2011, 11:19 AM

Quote:
Originally Posted by Matchewawa View Post
Just add a method for a mole to move up and then make an object variable with the list of moles in it. Then, drag the variable into the object name for the move up method, and choose "random item from list" or something like that. Then loop the method and they will randomly pop up.
Thank you
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.