A Galaga arcade-game clone that runs entirely in a terminal, written in Go with no external dependencies.
This is a totally vibe-coding repo. To build it I've used Open Code and Claude Sonnet 4.6.
- 5 × 8 enemy formation that sways and launches dive attacks
- Player movement, shooting, collision detection, scoring, lives, and stages
- 256-colour ANSI rendering at 45 fps with Unicode box-drawing borders
- Raw terminal mode via
syscallioctl — no external libraries
- Go 1.21+
- A terminal emulator that supports 256 colours and Unicode (xterm, Alacritty, iTerm2, GNOME Terminal, …)
- Linux (uses
TCGETS/TCSETSioctl)
go build -o galaga ./cmd/galaga/Or with the Makefile:
make build./galagaOr:
make run| Key | Action |
|---|---|
A or ← |
Move left |
D or → |
Move right |
Space |
Fire |
Q |
Quit |
make test # run tests
make lint # golangci-lint (requires golangci-lint v2)
make fmt # goimports
make vet # go vet
make all # fmt + vet + lint + test + buildInstall tooling:
go install golang.org/x/tools/cmd/goimports@latest
# golangci-lint: https://golangci-lint.run/usage/install/cmd/galaga/main.go entry point, game loop
internal/game/game.go state machine, physics, ANSI renderer
internal/term/term.go raw terminal mode, input goroutine
