For this week's assignment I wanted to create a rhythm game inspired by games like Just Dance and Dance Dance Revolution.
assemble the system
write and test a program for an embedded system using a microcontroller to interact (with input &/or output devices) and communicate (with wired or wireless connections)
After preparing the system for programming using this guide, I used the following pins to program my game:
- D1: left arrow
- D8: down arrow
- D0: up arrow
- D7: right arrow
- D9: Q1 (start / restart)
- D10: Q0 (pause / resume)
The game logic is a loop of game states controlled by boolean values for start, pause, and game-over scenes. The capacitive inputs are read each frame, and during active play, an update loop incrementally scales the speed and checks if falling notes pass the target squares.
Depending on the distance between target zone and user input, users receive feedback text (PERFECT, GOOD, BAD, or MISS) and corresponding LED colors (green, yellow, orange, red). These scores also determine the combo streak (reset by miss) and health bar (decreased by bad and miss). I used visual cues in both the UI and LED to increase feedback for every user input. I used Claude to help me debug my code, and explain to me how to program the UI.
try my game -> htmaa_dancedance.ino