Warning
This repository is a work-in-progress and is not yet production ready.
A classic Asteroids-style multiplayer game implemented using the Ebiten game engine. The networking layer is built from scratch over UDP for real-time online play.
Check out my YouTube video, "How I Implemented Multiplayer from Scratch in Golang", where I walk through the implementation details and explain my approach to synchronization using snapshot interpolation.
Before running the game, you need to follow Ebiten's installation guide. If you plan to run the server on a VPS, make sure Xvfb is installed and properly configured.
On Ubuntu/Debian systems, you can install it with:
sudo apt-get update
sudo apt-get install -y xvfb
For other platforms, refer to your system's package manager.
To run the game server, use the following command:
go run ./cmd/asteroids -listen [ADDR]
Replace [ADDR]
with the address and port you'd like the server to listen on.
For example, to listen on all network interfaces:
go run ./cmd/asteroids -listen 0.0.0.0:3000
To run the game client, use:
go run ./cmd/asteroids -connect [ADDR]
Replace [ADDR]
with the address of the server. For example, if the server is
running locally:
go run ./cmd/asteroids -connect 127.0.0.1:3000
Or, if you're connecting to a VPS:
go run ./cmd/asteroids -connect ip.of.your.vps:3000
Take control of your ship and survive the asteroid field! Here's how to navigate and fight:
- W – Thrust forward
- S – Thrust backward
- A – Rotate left
- D – Rotate right
- Space – Fire your weapon
- Destroy as many asteroids as you can without getting hit!
- Stay agile and keep moving — survival depends on your reflexes and aim.
Good luck, pilot! 🚀
I used the following materials during the development of this project:
This project is licensed under the MIT license.