Whack-A-Mole Game
This preset sets up a whack-a-mole style challenge where players start the round, react to target prompts across multiple buttons, and race to complete the objective before time or miss limits are reached. It includes the core game-state logic and output handling needed for an arcade-like prop interaction that can be tuned for difficulty and pacing.
This guide explains the built-in setup preset and the behavior pieces that make it work. The walkthrough video for the three advanced button presets is Advanced Button Games on YouTube.
Where to start
- Open the Prop Wizard or setup preset flow.
- Choose Whack-A-Mole Game from the available presets.
- Apply the preset.
- After the controller saves and reloads, inspect the generated sections listed below.
- Adjust pins and physical wiring in Configuration > Connections > Inputs, Outputs, and Modules before final testing.
Generated hardware
| Input | Type | Pin | Polarity | Pull-up |
|---|---|---|---|---|
| button1 | button | 42 | Active low | Pull-up on |
| button2 | button | 41 | Active low | Pull-up on |
| button3 | button | 40 | Active low | Pull-up on |
| button4 | button | 39 | Active low | Pull-up on |
| startButton | button | 38 | Active low | Pull-up on |
| Output | Type | Pin | Polarity | Behavior |
|---|---|---|---|---|
| relay | relay | 1 | Active high | Steady |
| Pixel strip | Pin | Pixels |
|---|---|---|
| pixels | 2 | 20 |
Game flow
- The
startButtonmoves the prop fromArmedintoMole 1. - Each Mole state lights a different pixel pair and waits for the matching button.
- A correct hit stops that mole feedback and advances to the next state.
- A wrong button or timer miss enters
Failed; finishing all moles entersSolvedand turns on the relay.
States and timers
The preset starts in Armed.
| State |
|---|
| Armed |
| Mole 1 |
| Mole 2 |
| Mole 3 |
| Mole 4 |
| Solved |
| Failed |
| State | Returns to | Delay | Timer id |
|---|---|---|---|
| Mole 1 | Failed | 1200 ms | mole1_window |
| Mole 2 | Failed | 1200 ms | mole2_window |
| Mole 3 | Failed | 1200 ms | mole3_window |
| Mole 4 | Failed | 1200 ms | mole4_window |
| Solved | Armed | 2500 ms | auto_Solved |
| Failed | Armed | 2000 ms | auto_Failed |
Variables
This preset does not rely on variables.
Input sequences
This preset does not use Input Sequences.
Logic rules
Logic Rules are the condition checks. They decide when a named event is true, but they do not directly move relays or pixels until an Action Trigger uses them.
| Rule | Match mode | Conditions |
|---|---|---|
| mole1Wrong | any | input button2 = true input button3 = true input button4 = true |
| mole2Wrong | any | input button1 = true input button3 = true input button4 = true |
| mole3Wrong | any | input button1 = true input button2 = true input button4 = true |
| mole4Wrong | any | input button1 = true input button2 = true input button3 = true |
Action triggers
Action Triggers are the work steps. They listen to inputs, logic rules, states, or sequences and then set states, variables, relays, and pixel effects.
| Action trigger | Source | Runs while | Steps |
|---|---|---|---|
| armed_reset | state:Armed (enter) | * | 0 ms: relay -> relay = off 0 ms: light_effect -> pixels = stop |
| start_game | input:startButton (true) | Armed | 0 ms: set_state -> Mole 1 |
| mole1_prompt | state:Mole 1 (enter) | * | 0 ms: light_effect -> pixels = start, solid, color #a00000, pixels 7,6 |
| mole2_prompt | state:Mole 2 (enter) | * | 0 ms: light_effect -> pixels = start, solid, color #00a52e, pixels 5,4 |
| mole3_prompt | state:Mole 3 (enter) | * | 0 ms: light_effect -> pixels = start, solid, color #0030b8, pixels 3,2 |
| mole4_prompt | state:Mole 4 (enter) | * | 0 ms: light_effect -> pixels = start, solid, color #a0a0a0, pixels 1,0 |
| mole1_hit | input:button1 (true) | Mole 1 | 0 ms: light_effect -> pixels = stop, pixels 7,6 0 ms: set_state_next |
| mole2_hit | input:button2 (true) | Mole 2 | 0 ms: light_effect -> pixels = stop, pixels 5,4 0 ms: set_state_next |
| mole3_hit | input:button3 (true) | Mole 3 | 0 ms: light_effect -> pixels = stop, pixels 3,2 0 ms: set_state_next |
| mole4_hit | input:button4 (true) | Mole 4 | 0 ms: light_effect -> pixels = stop, pixels 1,0 0 ms: set_state_next |
| mole1_fail | logic:mole1Wrong | Mole 1 | 0 ms: set_state -> Failed |
| mole2_fail | logic:mole2Wrong | Mole 2 | 0 ms: set_state -> Failed |
| mole3_fail | logic:mole3Wrong | Mole 3 | 0 ms: set_state -> Failed |
| mole4_fail | logic:mole4Wrong | Mole 4 | 0 ms: set_state -> Failed |
| whenFailed | state:Failed (enter) | * | 0 ms: light_effect -> pixels = stop 120 ms: light_effect -> pixels = start, scanner, color #ff3000, auto release 1200 ms |
| whenSolved | state:Solved (enter) | * | 0 ms: light_effect -> pixels = stop 0 ms: relay -> relay = on 0 ms: light_effect -> pixels = start, wave, color #00d95f, auto release 1600 ms |
What to customize first
- Rename inputs and outputs to match the physical labels on your prop.
- Confirm every generated pin matches the wiring shown on the board pinout.
- Adjust pixel strip count under Configuration > Lighting > Addressable Pixels if your strip is not 20 pixels.
- Change the reset timer or reset action if you do not want the game to automatically re-arm.
- Keep the generated Logic Rule names until the game is tested; the Action Triggers reference those names.