A new guide in the Adafruit Learning System: Chip’s Challenge on Metro RP2350.
While there are several guides on making some basic games in CircuitPython, they are meant to get you started with writing your own games. In this guide, I’ll go over making a more complex tile-based game that had originally been available for the Lynx and Microsoft Windows 3.1 as part of the Microsoft Entertainment Pack 4. The version that this code is based on is the Microsoft version.
Instead of building upon displayio for the most part, this game takes a more traditional approach and uses CircuitPython’s
bitmaptools
module to draw the graphics directly to the screen buffer. This includes some more unique features, such as keyboard input from the keyboard buffer. This allows input from either the serial terminal or using an attached keyboard for a standalone setup.The code is mostly based on Pocket Chips Challenge, which I had originally written for the Pocket PC using C++ in the early 2000s, and Tile World, which was written in C. Pocket Chips Challenge was never completed, and rewriting it in CircuitPython allowed me to finish the game. I could reuse most of the graphics I had made at the time, which were written for a 240×320 display. This includes a custom set of 24×24 pixel tiles, which I had redrawn based on the original 32×32 pixel tiles. The only graphics from the original game were the digits displayed on the right side.
Because of the limitations of writing it for a microcontroller, I had to find some creative ways to get the game to operate as quickly as possible…