Mini Battleship is a small artillery game I built on an STC15W204S 8051 microcontroller with a 128x64 OLED display and a rotary encoder for controls. The whole thing is written in C for SDCC and most of the project was focused on learning more about embedded systems, interrupts, and handling multiple systems at once on a small microcontroller.
The game uses integer based projectile physics with lookup tables instead of floating point math. Bullet movement is affected by firing angle, player movement, and wind, so shots do not always land in the same place. Enemy ships move across the screen and get faster after every hit.
Everything is controlled with a single rotary encoder. Turning it changes firing angle, pressing changes ship speed, and long pressing opens the menu system. Timer interrupts handle movement updates while external interrupts process encoder input.
I also wrote the OLED driver myself and built the menu system for things like pausing, hit detection, misses, and out of bounds shots. I still want to improve the enemy movement, add better sound effects, and design a 3D printed case for it later on.
Bohan Xu