Implementing Space Invaders Game on Hardware

GitHub Repo View the code on GitHub


Welcome to the Space Invaders Game repository! This repository contains a complete implementation of the classic arcade “space invaders” game. Let’s have a quick Demo of the Game in video below. I really recommend you to watch the video, it’s too much FUN.=)))))

Watch my video on youtube (click on the picture below):

Watch the video

Why do I Build games?
In the spring of 2026, I decided that I wanted to truly master RTL design, and I asked myself: what could be more joyful than building games in hardware?=)))
That question started my whole FPGA game‑development journey. Space Invaders became my fourth serious milestone, and probably my last gaming project for a while. As I’m writing this README, I can feel myself moving toward new challenges. Recently, I’ve been thinking about trying image and video‑processing projects on FPGA. I feel like I’ve done enough game projects, and now I want to explore something more advanced and closer to real industrial work. but who knows, I’ll see where the journey goes.
Through the space invaders game, I practiced real RTL design, timing, video output, and hardware‑driven game logic. This project is the point where my learning turned into something creative, fun, and fully my own.


Project Overview

The goal of this project is to recreate the retro Space Invaders experience on hardware. It features a player-controlled “Space Sheep” (my version of spaceship), waves of moving invaders, a mysterious UFO, and a projectile system for both the player and the enemies. The game manages different states, such as the start screen, active gameplay, losing lives, and the “Game Over” or “Win” conditions. Everything is synchronized to a 640x480 VGA timing at 60Hz(which will be displayed on monitor using HDMI port) and includes I2S-based audio for sound effects and music. The game uses UART-RX interface and player can communicate with game using a keyboard which is connected to a PC.

A fun thing to add here: when I started writing this game, I began with the spaceship logic. At the moment I was writing the spaceship module, I couldn’t remember the exact spelling of the word “spaceship”. I wasn’t sure if it was “spacesheep” or “spaceship”, so I just wrote “spacesheep” and continued with it.
When I reached the end of the project, I realized, “oh no! I chose the wrong spelling”, but it was too late. So I decided to keep it as “spacesheep”. Whenever you see “spacesheep” in the code, it actually means “spaceship”. I kept it as a funny part of this project, since it doesn’t affect the game logic at all.
By the way, I’m pretty sure that if my high‑school English teacher read this, she wouldn’t be very happy with me. hahaha =)))


System Architecture

The architecture follows a hierarchical structure where a Top-Level Module (top/space_invaders_top) connects various sub-systems:

The Space Invaders Game’s Block Diagram:

The Space Invaders Game's Diagram

State Machine(FSM):

The logic/space_invaders_SM module serves as the central “brain” of the project, utilizing a Finite State Machine (FSM) to manage the game’s lifecycle through five primary states:

The Space Invaders Game's FSM

The module controls the behavior of other system components by outputting specific enable signals (such as o_run_en or o_start_en) and tracking game data like entity positions and remaining lives.


Module Explanations

Let’have a look at Space Invaders Game’s flow chart and explore the functionality of each module in detail.

The Space Invaders Game's Flow Chart

Core Game Logic & Control

Movement & Mechanics

Graphics & Display

Input & Audio


Setup Guide

Using UART to USB cable, connect your PC’s serial output(USB port) to the FPGA board. Then Open a terminal emulator like PuTTY or Tera Term. Select the “Serial” connection type and enter the following settings:

For the Cyclone V GX FPGA Board, I have used the follwing Pinout table:
Click here to open the Pinout-Table.CSV