Blog

Creating a Plane Shooting Game with STM32 and OLED Display

Table of Contents

Today I’m excited to share a fun DIY project: a classic “Plane Shooting Game” built using an STM32 microcontroller and a 0.96” OLED display LGO12864A-096.

This mini game combines simple hardware with nostalgic arcade-style gameplay — perfect for electronics enthusiasts and embedded system learners.

The effect screenshots are as follows:

You can also check out the video demonstration effect:

🎬 Demo & Screenshots

Here’s a glimpse of the gameplay:

  • Game Start Screen
  • In-Game Action
  • Game Over Scene
  • Victory Screen

🎥 You can also check out the full demo video for a better look at the effects in motion.


🔧 Hardware List

  • STM32F103C8T6 minimum system board
  • 0.96” SSD1306 OLED display (128×64 resolution)
  • 5 physical buttons


🕹️ Button & OLED Wiring

FunctionSTM32 Pin
Move DownPA4
Move RightPA5
Move UpPB11
Move LeftPB10
ShootPA7
OLED SCKPA11
OLED SDAPA12

⚙️ Compilation & Download

  • Development environment: Keil uVision
  • HAL Library: Used for peripheral configuration’s

  • Compiler requirement: ARM Compiler v6 or higher

  • C++ version: Make sure it’s set to C++11 or higher

✅ If you’re using the provided source code, everything is already pre-configured.
⚠️ If you’re compiling manually and run into issues, double-check the compiler and C++ settings above.


🕹️ Game Overview

  • Your plane can move up, down, left, right (on the left half of the screen)
  • Shoot bullets to destroy incoming enemies
  • Each enemy has 5 HP, so you need to hit them 5 times to eliminate them
  • The game has clear start, win, and fail scenes with smooth transitions

This is the scene at the beginning of the game:

This is the scene in the game:

This is the scene of the game’s failure:

This is the scene of the game’s success:

It’s simple but surprisingly fun — and a great way to explore embedded graphics and input handling!


📂 Get the Source Code

The full project has been open-sourced!
To get the code or collaborate, feel free to reach out:

👉 Contact us at www.longtech-display.com

Request Free Quote Now!

*We respect your confidentiality and all information is protected.

Hey there, I'm Mr.Zhong!

Sales Engineer

I really enjoy the technology behind LCD display because my work contributes to enhancing the visual experience of various devices. If you have any questions about LCD display, feel free to contact me!

Get Started With Us

*We respect your confidentiality and all information is protected.