A classic Space Invaders game built with GoLang and the Ebitengine game engine.
- Classic arcade gameplay
- Multiple levels with increasing difficulty
- Animated aliens and starfield background
- Score tracking and lives system
- Smooth player controls
- Left/Right Arrow or A/D: Move the ship
- Space or W: Shoot
- Enter: Start game or proceed to next level
- R: Restart game after Game Over or Win
- Game Loop: Understanding the Update/Draw cycle.
- Entity Management: Handling multiple game objects (player, aliens, bullets).
- Collision Detection: Simple AABB (Axis-Aligned Bounding Box) collision.
- Game States: Managing Title, Playing, Level Clear, and Game Over states.
- Graphics: Using vector drawing and color manipulation for visuals.
- Go 1.22+
- CGO dependencies (for default build) or
ebitenginepuregotag.
To build the game:
go build -tags=ebitenginepurego -o space-invaders main.goTo run the game:
./space-invadersmain.go- Entry point and main game loopentities/- Player, aliens, and bullet entitiesgame/- Game state managementcollision/- Collision detection logic
