Building a Tower Defense Game on a Conference Badge

mojoe2 pts0 comments

Compelling Science Fiction Newsletter

Building a Tower Defense Game on a Conference Badge<br>by Joe Stech

2026-06-14

Note: you can play a web-based version of this game right now, link at bottom of the post.

Last October at the GitHub Universe conference, Arm (the semiconductor company I work for) sponsored a super cool little smart badge powered by a Raspberry Pi (RP2350 Dual-core ARM Cortex-M33 @ 200MHz). It has a little color screen, wifi, and an 8-hr battery.

The badge has been sitting on my desk since then, and I decided that this was a good weekend to turn the badge into a learning experience with my kids.

I've always loved tower defense games, and the kids had never played one before, so I figured we'd start there. I also decided to make it GitHub-themed, since it's a GitHub Universe badge, and it would be fun to make a PR with the kids to the badge repo.

First, I told the kids that if they drew little enemies, we'd use those in the game. The sprites needed to be tiny, because the screen isn't very high resolution (320x240 IPS display, pixel doubled to 160x120).

The kids created three enemies — a red 'bot', an orange 'spaghetti code', and their favorite, a purple 'merge conflict' character they called 'Stuart' (they kept getting fits of giggles when saying "stuart").

They also made a star sprite for in-game currency and a heart sprite for health, which they put sunglasses on because they are the best kind of goofs.

We also made tower sprites. Green "test code" towers, a slowing tower called "permissioning" (permissions slow everything down, don't they), and a powerful "Code Reviewer" tower.

Building the game

Once we had the sprites together, we wrote a detailed specification for the game. The kids thought I was some kind of game design genius, because they had never encountered the concept of tower defense before. I had to explain that this was a common game type.

We then used Claude Code on the spec, which wrote the first draft of the micropython. There were some issues with button controls and pathing on that initial build, which we fixed, and we had a working game!

Polishing and balancing the gameplay

The kids were absolutely overjoyed to see stuart walking across the screen, but there were some severely fun-impairing issues with the first version.

Graphics issues. Claude has some problems with spatial awareness, so the sprites weren't where they should be. We had to adjust their locations to make the game look like something that could have been on an early game console.

A gentler on-ramp. The early waves started too fast. We made wave 1 a slow trickle of just the weakest enemy, gave the player a generous 30-second build phase before anything spawns, to plan out strategy.

A real difficulty curve. We adjusted the difficulty of the level ramp up over and over, so that for the kids the first level felt doable but it got really tricky for them by the end.

Tougher tanks. The armored "Spaghetti Code" enemy got a big health boost so that Code Reviewer towers are necessary in the endgame.

Economy tweaks. We bumped the reward for killing the weak bots so the early game gives you enough currency to start making interesting choices sooner.

Tower tuning. We made the expensive "Code Reviewer" tower fire a bit faster so it's less of a one-trick anti-tank pick, and nudged up the price of the slowing tower since it was a little overpowered for the price (hint: it still kind of is).

We also reworked how the maps generate. The original carved narrow corridors through solid walls. We changed it to just a few solid blobs which change the pathing each game, which means the player is forced to build a unique maze each time, which is the heart of what makes tower defense satisfying to me.

What the kids took away

More than designing the game, I think what stuck most for the kids was the loop of changing something, copying it over, playing it, deciding if it's better, and repeating over and over. Watching a number change from 200 to 400 and then feeling that enemy become scarier on the next playthrough is a kind of cause-and-effect that's hard to learn any other way. I highly recommend doing this activity with any kids in your life!

If you want to try it out, I ported it over to javascript so it can be played here (it's a ten-minute playthrough): Code Defender for Web

And if you have one of these Raspberry Pi conference badges, you can install the game on your badge from GitHub here: Code Defender for Conference Badge

Joe

Want to follow along?

Sign up for the newsletter.

Email address

Get the newsletter

game tower kids badge code defense

Related Articles