Raspberry Pi Pico Plays MicroPython River Raid
A name badge becomes a game badge!
Pimoroni's Tufty2040 is a Raspberry Pi Pico-powered color LCD badge, but it can do much more than names. Coder Pixylatte has coded the Atari classic River Raid in MicroPython for Tufty2040 — and it looks perfect.
I had to move the display object to a singleton due to memory fragmentationbut behold, an atari game written in micropython on my @pimoroni tufty2040 badge because why not pic.twitter.com/lqF3Cb0pZWMarch 29, 2023
For those of us too young to remember (I wish that were the case), River Raid was released in 1982 for the Atari 2600 games console (I remember playing it on a Commodore 64). The goal of the game is to fly your jet fighter down a river, attacking enemy vehicles as you fly. You have to dodge attacks and vehicles and make sure you have enough fuel to carry on your mission — "Don't shoot the fuel tanks," is what I would tell my younger self.
The game never ends, but bridges act as checkpoints along the way to measure your progress, and each life lost returns you to the previous bridge.
Row 0 - Cell 0 | RP2040 | Atari VCS 2600 |
Release Date | January 22 2021 | September 1977 |
CPU | RP2040 Arm Cortex M0+ Dual Core at 133 MHz | 8-bit MOS Technology 6507 @ 1.19 MHz |
RAM | 264KB SRAM | 128 bytes |
Storage | 2MB Flash | River Raid used a 4KB ROM cartridge |
Cost | Tufty2040 $23 | $190 (adjusted for inflation is approximately $850) |
Pixylatte's version of the game is coded entirely in MicroPython, and is added as a menu item to the default Tufty 2040 menu. This means that a simple name badge can be quickly turned into a game badge when we're taking a break at a conference!
The coding for the game is fabulous — it uses a sprite map (a large grid of sprites that are swapped as needed) for the game assets. The MicroPython code reacts to player input to control the direction and speed of the jet, along with a button to fire at your enemies. The enemy sprites fly left to right on the screen, dodging your fire as your fly further up the river.
Protecting Tufty2040 from the rigours of gaming is a 3D printed case — one that could be easily reproduced on any of the best 3D printers. The case, designed by Funkypiwy (aka Pierre-yves Baloche) provides great protection to the perimeter of Tufty2040 and also has an optional stand. It appears that Pixylatte has printed a different case back — one which has an integrated coin cell battery pack. You can also design your own case for the Tufty2040.
Pixylatte's project is great fun — you can find all of the details on their GitHub repository.
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".