Skip to content

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

  1. Open the Prop Wizard or setup preset flow.
  2. Choose Whack-A-Mole Game from the available presets.
  3. Apply the preset.
  4. After the controller saves and reloads, inspect the generated sections listed below.
  5. Adjust pins and physical wiring in Configuration > Connections > Inputs, Outputs, and Modules before final testing.

Generated hardware

InputTypePinPolarityPull-up
button1button42Active lowPull-up on
button2button41Active lowPull-up on
button3button40Active lowPull-up on
button4button39Active lowPull-up on
startButtonbutton38Active lowPull-up on
OutputTypePinPolarityBehavior
relayrelay1Active highSteady
Pixel stripPinPixels
pixels220

Game flow

  • The startButton moves the prop from Armed into Mole 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 enters Solved and turns on the relay.

States and timers

The preset starts in Armed.

State
Armed
Mole 1
Mole 2
Mole 3
Mole 4
Solved
Failed
StateReturns toDelayTimer id
Mole 1Failed1200 msmole1_window
Mole 2Failed1200 msmole2_window
Mole 3Failed1200 msmole3_window
Mole 4Failed1200 msmole4_window
SolvedArmed2500 msauto_Solved
FailedArmed2000 msauto_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.

RuleMatch modeConditions
mole1Wronganyinput button2 = true
input button3 = true
input button4 = true
mole2Wronganyinput button1 = true
input button3 = true
input button4 = true
mole3Wronganyinput button1 = true
input button2 = true
input button4 = true
mole4Wronganyinput 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 triggerSourceRuns whileSteps
armed_resetstate:Armed (enter)*0 ms: relay -> relay = off
0 ms: light_effect -> pixels = stop
start_gameinput:startButton (true)Armed0 ms: set_state -> Mole 1
mole1_promptstate:Mole 1 (enter)*0 ms: light_effect -> pixels = start, solid, color #a00000, pixels 7,6
mole2_promptstate:Mole 2 (enter)*0 ms: light_effect -> pixels = start, solid, color #00a52e, pixels 5,4
mole3_promptstate:Mole 3 (enter)*0 ms: light_effect -> pixels = start, solid, color #0030b8, pixels 3,2
mole4_promptstate:Mole 4 (enter)*0 ms: light_effect -> pixels = start, solid, color #a0a0a0, pixels 1,0
mole1_hitinput:button1 (true)Mole 10 ms: light_effect -> pixels = stop, pixels 7,6
0 ms: set_state_next
mole2_hitinput:button2 (true)Mole 20 ms: light_effect -> pixels = stop, pixels 5,4
0 ms: set_state_next
mole3_hitinput:button3 (true)Mole 30 ms: light_effect -> pixels = stop, pixels 3,2
0 ms: set_state_next
mole4_hitinput:button4 (true)Mole 40 ms: light_effect -> pixels = stop, pixels 1,0
0 ms: set_state_next
mole1_faillogic:mole1WrongMole 10 ms: set_state -> Failed
mole2_faillogic:mole2WrongMole 20 ms: set_state -> Failed
mole3_faillogic:mole3WrongMole 30 ms: set_state -> Failed
mole4_faillogic:mole4WrongMole 40 ms: set_state -> Failed
whenFailedstate:Failed (enter)*0 ms: light_effect -> pixels = stop
120 ms: light_effect -> pixels = start, scanner, color #ff3000, auto release 1200 ms
whenSolvedstate: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.