Shop OBEX P1 Docs P2 Docs Learn Events
Whack a mole — Parallax Forums

Whack a mole

PF89PF89 Posts: 3
edited 2010-01-20 14:54 in BASIC Stamp
HOw to make a whack a mole game?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-19 13:54
    Start with a piece of 3/4 inch plywood, and a hole-cutter of the correct diameter.

    Wait, maybe you need to get 9 stuffed moles first -- that'll tell you what the "correct diameter" above is.

    ************

    Let me start again.

    Complicated questions get simple, straightforward, helpful answers.
    Very simple questions, get long, rambling, could be helpful but usually not, answers.
    I think you've asked WAY too simple a question.
  • PF89PF89 Posts: 3
    edited 2010-01-19 13:54
    This seem to be a very hard, fun activity for me , if anyone can perhaps type out the precise code, that i need to use to make the program or any help at all will be helpfull thnks ju
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-19 14:06
    PF89 said...
    This seem to be a very hard, fun activity for me , if anyone can perhaps type out the precise code, that i need to use to make the program or any help at all will be helpfull thnks ju
    Er, that's not very likely to happen. Most importantly, you haven't "specified your requirements" at all. In plain English, you haven't really said anything about what you're asking for. Are you talking about a "whack-a-mole" video game, with everything simply animated on a screen? Or are you talking about a physical, real game, with moles popping up through little holes for the player to hit with a hammer?

    Once you've made that clear, there's still a lot of other details, and no-one can really help you unless you've described exactly what you want.

    That being said, it's also very unlikely that someone is going to just sit down and type out the code for your project. It would be a big task. What you need to do is to play around with it yourself - figure out what the pieces you need are, and ask about how to make them happen. For example, if it's supposed to be a physical whack-a-mole game, you might ask people how to sense when a mole has been "whacked".
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-19 14:26
    You haven't even specified how the 'mole' rises, what happens when you "whack" it (don't want to damage anything), how you sense a "whack", etc.

    You could resolve these issues with a single-mole prototype to prove out whatever approach you select.
  • ercoerco Posts: 20,256
    edited 2010-01-19 17:00
    http://cgi.ebay.com/WHAC-A-MOLE-ELECTRONIC-GAME_W0QQitemZ180410731732QQ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • PF89PF89 Posts: 3
    edited 2010-01-19 17:10
    i need the code to make a whack-a-mole game using LEDs eith the basic stamp editor program. We use Sumobots in schol and program them with the basic stamp editor.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-01-19 17:25
    Ah, now we're getting somewhere. So the "mole" is a lit LED then? And I assume near the lit LED is a switch that must be closed in a certain period of time?

    See, these are the sorts of things that need to be specified.
  • FranklinFranklin Posts: 4,747
    edited 2010-01-19 20:21
    Show us the circuit you plan to use and how you have it connected to the stamp, that would help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike2545Mike2545 Posts: 433
    edited 2010-01-20 00:15
    couldn't resist Whack_a_Mole_by_nickel11_by_TheTardClub.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-20 14:54
    PF89 said...
    i need the code to make a whack-a-mole game using LEDs eith the basic stamp editor program. We use Sumobots in schol and program them with the basic stamp editor.
    So what you need is
    - To use a Stamp to randomly light up one LED in an array of LEDs
    - To detect whether or not a button next to the lit LED is pressed within a certain period of time
    - To keep count of the correct presses within the time limit

    It's an interesting problem. Your first step should be to get the Stamp to light up just one LED at some random time. Then add the part of the program that reads whether or not the button was pressed within that amount of time. Doing it with just one LED and one button will keep your circuitry very simple, so you can concentrate on figuring out the programming part. Then add a second LED and a second pushbutton. That will take nothing more than a second copy of the original circuit. The basic "What's a Microcontroller?" book will show you how to hook up an LED and a pushbutton:

    http://www.parallax.com/Store/Books/EducationalTexts/tabid/181/CategoryID/66/List/0/Level/a/ProductID/139/Default.aspx?SortField=ProductName%2cProductName

    (notice that you can read the text online, if you can't afford to buy a hard copy).

    At some point as you add more LEDs you might run into the problem that the Stamp can only light so many LEDs at once. On the other hand, since only one "mole" should be active at a time, you might well be able to simply add LEDs and pushbuttons until you've used up all of your I/O pins. On a regular Stamp, you have 16 I/O pins, so you could have 8 "moles" (8 LEDs, 8 pushbuttons). A BS2p40 would give you enough I/O for 16 "moles".
Sign In or Register to comment.