Tower of Lights Game

by kamrath in Living > Toys & Games

7 Views, 0 Favorites, 0 Comments

Tower of Lights Game

IMG_5120.jpeg

Tower of Lights is a fun and interactive timing-based game built using Adafruit's Circuit Playground Bluefruit and a 30-light NeoPixel strip. The game challenges players to press a button exactly when a moving light overlaps a fixed target light. This project combines visual feedback, real-time controls via a potentiometer, and customizable celebratory animations — making it a perfect introduction to embedded systems, accessible design, and game creation.

Whether you're a student, hobbyist, or educator, this project teaches hands-on electronics, coding in CircuitPython, and physical computing fundamentals — all while building something engaging and fun.


(Video Demo Below)

Supplies

Screenshot 2025-05-04 at 4.12.56 PM.png

Supplies Needed

  1. Adafruit Circuit Playground Bluefruit
  2. 30-Light NeoPixel Strip
  3. One External Button (wired to Ground and A4 via aux cable or pushbutton)
  4. One 10k Potentiometer (wired to 3.3V, GND, and signal to A6)
  5. Small breadboard or soldered connections
  6. USB cable (for uploading code)
  7. Optional: Acrylic backing or tube to mount the NeoPixel strip vertically (like a light tower)

Assembly Instructions

  1. NeoPixel strip: connect DIN (signal) to A1, 5V to VOUT, and GND to GND.
  2. Potentiometer:
  3. Middle pin → A6
  4. One outer pin → GND
  5. Other outer pin → 3.3V
  6. Button:
  7. One side to A4
  8. One side to GND
  9. Use pull-up configuration in code
  10. Mount components on a stand or enclosure as needed. Ensure light visibility and ergonomic access to the button and knob.

Game Rules and How It Works

chuckecheese.jpeg

This game is similar to a popular "Circle of Lights" game that could found at arcades like Chuck E Cheeses (displayed in picture above).

One moving light scrolls smoothly up and down a vertical light strip ("Tower").

One target light stays fixed in a random position.

The player’s goal: press the button exactly when the moving light overlaps the target.

A potentiometer allows you to adjust how fast the light moves (between 1 light/sec and 1 light every 10 seconds).

Each successful match triggers a rotating visual celebration, such as rainbow waves or soft color wipes.

Win streaks cycle through different animations, keeping the gameplay fresh and satisfying.

Building the Case

IMG_1917.jpg
IMG_1918.jpg
IMG_1916.jpg
IMG_1927.jpg

To complete the Tower of Lights as a finished, playable device, I designed and built a two-part wooden enclosure using laser-cut plywood. The bottom box houses the Circuit Playground Bluefruit, potentiometer, button plug-in, USB connection, and all necessary wiring. It should be at least 3.5 inches on each side to provide enough internal space for routing wires and suspending components. This box includes custom-cut holes: one each for the USB cable, potentiometer knob, and button jack, as well as a slot at the top for the light strip to pass into the upper box. The top box serves as a display tower for the LED strip and must be as long as your NeoPixel strip (ours was 1 meter). One face of this tower is made of acrylic or another transparent material to allow the colorful lights to shine through during gameplay. Inside the lower housing, I added scaffolding supports made from wood scraps or brackets to hold the Bluefruit and potentiometer in place securely and keep wires cleanly routed.

Writing and Uploading the Code

You’ll write the game using CircuitPython.

  1. Install CircuitPython on your Bluefruit board.
  2. Ensure you have the following libraries in your lib folder:
  3. neopixel.mpy
  4. adafruit_led_animation
  5. Paste the full game code (provided above) into code.py on your CIRCUITPY drive.
  6. Save and reboot the board — the game starts automatically.
💡 The code handles movement logic, win detection, speed control, and rotating celebration animations.


How Hardware and Code Interact

  1. The NeoPixel strip visually represents the gameplay state — showing both moving and target lights.
  2. The button detects player interaction and determines if a win condition is met.
  3. The potentiometer feeds live analog values to adjust the movement speed, giving real-time difficulty control.
  4. The code reads all input, updates the light strip accordingly, and handles celebration animations upon successful play.

This fusion of inputs and feedback creates a dynamic, interactive experience with intuitive control.

Downloads

Accessibility and Adaptation Ideas

Tower of Lights can easily be adapted to serve a broader audience, including users who may have physical disabilities that may make the game more challenging:

  1. The potentiometer allows for the moving light to have a range of pace from a top speed of 1 light per second to a slow, deliberate 1 light per 10 seconds. This can give some users more time to react. This can also be altered if you want the game to move more quickly by changing the MAX_SPEED_DELAY and MIN_SPEED_DELAY to lower numbers.
  2. The game is adaptable to different types of buttons. The plug-in cord for buttons enables this. If a user cannot effectively use a certain type of button, they can plug in a button more adapted to their skillsets.
  3. The project can be played with the light strip vertical or horizontal, to allow for a more customized experience.