Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   Whack a Mole Game Help! (http://www.alice.org/community/showthread.php?t=11908)

pyrogirl8 02-18-2018 05:29 PM

Whack a Mole Game Help!
 
1 Attachment(s)
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!

sometimes618 02-19-2018 07:47 AM

[QUOTE=pyrogirl8;57863]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![/QUOTE]

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.

chickentree 02-22-2018 02:43 PM

Alice 3 Guess
 
[QUOTE=pyrogirl8;57863]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![/QUOTE]

Like many of us in the Alice forum, I am not familiar with Alice 3 so take this with a dram of disbelief.[LIST=1][*]Select performCustomSetup[*]At the bottom of the performCustomSetup window drag a variable into the window.[*]In the insert variable pop-up that appears:[/LIST][INDENT][LIST=1][*]Select the variable radio button.[*]Set value type: to gopher (in gallery class.)[*]Check the is Array box[*]Give the array a sensible name (like gophers)[*]Click the initializer and add all your gophers to the array (one at a time.)[/LIST][/INDENT]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

MrMoke 02-23-2018 01:19 PM

1 Attachment(s)
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.

chickentree 02-23-2018 06:43 PM

1 Attachment(s)
[QUOTE=MrMoke;57869]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.[/QUOTE]

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

kelbstar123 02-25-2018 01:21 AM

Collision detection
 
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...
[url]https://www.youtube.com/watch?v=me4otuEpJe0[/url]
this should work if you cant do it.I recommend sketchup for ideas.
[url]https://www.sketchup.com/[/url]

kelbstar123 02-25-2018 01:22 AM

Collision detection
 
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...
[url]https://www.youtube.com/watch?v=me4otuEpJe0[/url]
this should work if you cant do it.I recommend sketchup for ideas.
[url]https://www.sketchup.com/[/url]
02-23-2018 07:43 PM

simonvarez 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

[URL="https://www.bevybar.com.ar/"]bevy[/URL]


All times are GMT -5. The time now is 01:38 AM.

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