A fun exercise in coding a simple game for a tiny development board.
George Gray has fond memories of his early days of programming, back when having 4k of programming memory was a luxury. His career has taken him a long way from that old programming style, but he never forgot.
When he found microcontrollers and started playing, he was suddenly thrust back into that familiar world of limited space. George has an appreciation for the skill required to program in such little space, so he jumped in enthusiastically.
He got his hands on an Adafruit Trinket, which has 5.2k of available programming memory, and decided he was going to make a video game. Of course, he was going to need an interface of some kind to play a game; in this case, he chose a cheap 2x16 character LCD and a single push button. His first goal was to make a proof of concept that played like Space Invaders, or as close to it as he could get on a 2x16 screen. Keep in mind that the screen also has a library that is going to have to be loaded in that programming memory, reducing his available memory to 5.1k!
After digging through some old notes he had from programming on the TRS-80, he began programming. The Space Invaders idea was coming together when he noticed one of the available characters to the display looked a lot like the Battlestar Galactica. This gave him an idea.
Here's his description from his blog:
First, I needed an idea. The display I am using, from Parallax, allows for eight special characters. So, I played around with a few designs and one of them looked like the Battlestar Galactica. After some thought, I had the idea: The Galactica's Viper squadrons are out on patrol. The Galactica was in a fierce battle that has rendered it nearly immovable, it can only hyperjump. It's turrets are all damaged, save the forward bank, she can only shoot from her forward cannons. A Cylon has discovered the Galactica and is taking runs at it. Problem is, the Cylon is jumping randomly, making a direct hit nearly impossible. If, however, the Galactica does manage to destroy the Cylon, the Galactica then hyperjumps too. Then, it all happens again.
The final result works as planned, though he does say it can be a bit challenging. If you're interested in recreating this experiment, he has the entire code available for download on his blog.