Building a Whack-A-Mole Game With rn-sprite-sheet

1 min read Original article ↗

A walk through building this classic game with a new twist

Tamas Szikszai

Press enter or click to view image in full size

Today I’m going to recreate another classic game in React Native: Whack-A-Mole. The mechanical version of this game was an arcade fan-favourite in the late ‘70s and early ’80s. Since then numerous clones on various devices have been made.

TL;DR #1: Watch the video:

TL;DR #2: Grab the source code from GitHub

The gameplay is super simple. On the screen we display 12 slots. Moles will pop out of these slots and then disappear again at a rapid pace — the players’ goal is to hit as many of them on the head as possible. As a twist to the original, I want to introduce three different kinds of moles:

  • “Neutral”: this mole deals no damage if not “whacked”, but when hit the player will still receive points.
  • “Feisty”: This mole attacks the player if not whacked in time, dealing damage.
  • “Healer”: If whacked it will restore the player’s health a little bit.