A Galaxian (1979, Namco) arcade clone written in GnuCOBOL with ncurses terminal graphics.
- GnuCOBOL 3.2+ (
cobc) - ncurses (macOS: built-in, Linux:
sudo apt install libncurses-dev) - Terminal 80×24 minimum
make
./galaxian| Key | Action |
|---|---|
A / ← |
Move left |
D / → |
Move right |
SPACE |
Fire (one bullet at a time) |
Q |
Quit |
- Destroy all 46 aliens to advance to the next wave
- Aliens fly in formation and periodically dive-bomb your ship
- Diving aliens shoot back — dodge or destroy them
- 3 lives, bonus life at 5,000 points
- Each new wave is faster and more aggressive
| Enemy | In Formation | Diving |
|---|---|---|
Blue (W) |
30 | 60 |
Purple (M) |
40 | 80 |
Red (V) |
50 | 100 |
Flagship ($) |
60 | 150 |
| File | Lines | Description |
|---|---|---|
GALAXIAN.cob |
755 | Game logic — init, game loop, AI, rendering |
utils.c |
65 | ncurses C bridge — input, display, timing |
Makefile |
18 | Build system |
All game logic is in COBOL. The C bridge (utils.c) provides 8 functions for ncurses access:
initWindow, getKey, showAt, showStrAt, clearZone, refreshScr, delay, resetWindow.
COBOL handles everything else: 46-alien array management, formation movement, 4-phase dive AI, collision detection, scoring, wave progression, and rendering at 30 FPS.
MIT

