Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
Whack a Mole Game Help!
Old
pyrogirl8
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jan 2018
Default Whack a Mole Game Help! - 02-18-2018, 05:29 PM

I'm trying to make a Whack a Mole Game for Alice 3, and I have made a list of gophers (there were no moles) but my issue now is I can't get that list of gophers into something I can use. By that I mean in the drop down box where you can select objects, there's "this", "thisWackaMole", "thisGround" and "thisGopher" 0-11, but I don't have a "thisGophers" that I can use to do like "thisGophers" move UP. I need them all to move at random as well, which I need help with. I don't know how to get it to select a random Gopher.
Thanks!
Attached Files
File Type: a3p wacamole1.a3p (223.6 KB, 42 views)
   
Reply With Quote
Old
sometimes618
Member
 
Status: Offline
Posts: 39
Join Date: Jan 2016
Location: J Street
Default 02-19-2018, 07:47 AM

Quote:
Originally Posted by pyrogirl8 View Post
I'm trying to make a Whack a Mole Game for Alice 3, and I have made a list of gophers (there were no moles) but my issue now is I can't get that list of gophers into something I can use. By that I mean in the drop down box where you can select objects, there's "this", "thisWackaMole", "thisGround" and "thisGopher" 0-11, but I don't have a "thisGophers" that I can use to do like "thisGophers" move UP. I need them all to move at random as well, which I need help with. I don't know how to get it to select a random Gopher.
Thanks!
I don't really use Alice 3, so I'm not sure how much help I can be, but...
What I tried was that I used "each in _ together" and put every gopher in an array for it. I made it so that in the "each in" thing, the gopher would delay a random number of seconds and then move up and down.
Again, there's probably a better way to do this, but I gave it a shot.


Starring, written, directed, and produced by sometimes618.

Get Alice Fighters v0.7:
http://www.alice.org/community/showthread.php?p=57651#post57651
   
Reply With Quote
Alice 3 Guess
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default Alice 3 Guess - 02-22-2018, 02:43 PM

Quote:
Originally Posted by pyrogirl8 View Post
I'm trying to make a Whack a Mole Game for Alice 3, and I have made a list of gophers (there were no moles) but my issue now is I can't get that list of gophers into something I can use. By that I mean in the drop down box where you can select objects, there's "this", "thisWackaMole", "thisGround" and "thisGopher" 0-11, but I don't have a "thisGophers" that I can use to do like "thisGophers" move UP. I need them all to move at random as well, which I need help with. I don't know how to get it to select a random Gopher.
Thanks!
Like many of us in the Alice forum, I am not familiar with Alice 3 so take this with a dram of disbelief.
  1. Select performCustomSetup
  2. At the bottom of the performCustomSetup window drag a variable into the window.
  3. In the insert variable pop-up that appears:
  1. Select the variable radio button.
  2. Set value type: to gopher (in gallery class.)
  3. Check the is Array box
  4. Give the array a sensible name (like gophers)
  5. Click the initializer and add all your gophers to the array (one at a time.)
You should now have an array of gophers that you can select using the other actions in the performCustomSetup window and be able to program the game much like the example in the Alice 2 Programming book.

Mark


Mark Henwood
mhenwood@ieee.org

Last edited by chickentree; 02-22-2018 at 02:45 PM. Reason: Clearity
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Cool 02-23-2018, 01:19 PM

Navigating the interface in Alice3 takes a while to get comfortable with. The attached example is very basic, would require extra work to make the game, but demonstrates random selection.
Attached Files
File Type: a3p WhackaMole.a3p (40.8 KB, 48 views)
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 02-23-2018, 06:43 PM

Quote:
Originally Posted by MrMoke View Post
Navigating the interface in Alice3 takes a while to get comfortable with. The attached example is very basic, would require extra work to make the game, but demonstrates random selection.
Hi Mr Moke,
Attached is your example with two changes. I used a timer event and changed the random number routine to use the length of the mole list ( the original code never moved the last mole.)
The timer avoids the infinite loop problem making it easier to add other methods etc without having to do it all within the loop.

Mark
Attached Files
File Type: a3p WhackAMoleEvent.a3p (41.1 KB, 77 views)


Mark Henwood
mhenwood@ieee.org
   
Reply With Quote
Collision detection
Old
kelbstar123
Member
 
Status: Offline
Posts: 20
Join Date: Feb 2018
Location: https://t.me/pump_upp
Default Collision detection - 02-25-2018, 01:21 AM

Your answer is collision detection so when one thing hits it then it won't go through... the you can edit code it to so it can add points...
https://www.youtube.com/watch?v=me4otuEpJe0
this should work if you cant do it.I recommend sketchup for ideas.
https://www.sketchup.com/
 Send a message via ICQ to kelbstar123 Send a message via Yahoo to kelbstar123 Send a message via AIM to kelbstar123  
Reply With Quote
Collision detection
Old
kelbstar123
Member
 
Status: Offline
Posts: 20
Join Date: Feb 2018
Location: https://t.me/pump_upp
Default Collision detection - 02-25-2018, 01:22 AM

Your answer is collision detection so when one thing hits it then it won't go through... the you can edit code it to so it can add points...
https://www.youtube.com/watch?v=me4otuEpJe0
this should work if you cant do it.I recommend sketchup for ideas.
https://www.sketchup.com/
02-23-2018 07:43 PM
 Send a message via ICQ to kelbstar123 Send a message via Yahoo to kelbstar123 Send a message via AIM to kelbstar123  
Reply With Quote
Old
simonvarez
Banned
 
Status: Offline
Posts: 10
Join Date: Mar 2018
Default 03-16-2018, 11:03 AM

Tiendan Bar a domicilio en Argentina, ofrece las mejores bebidas y ofrece el ingreso al club de la cerveza

bevy
   
Reply With Quote
Reply

Tags
alice 3, array, list, mole, wack

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.