A fast-paced retro space arcade game built entirely inside the terminal. This project showcases cooperative multitasking and asynchronous programming in Python using native coroutines (generators driven by hand-crafted event-loops) inside a curses text interface.
- Language: Python 3.10+
- TUI Framework: Native
curseslibrary - Async Model: Cooperative multitasking via Python coroutines (async / await syntax)
- Operating System: Linux, macOS, or Windows (via WSL 2)
.
├── frames/ # Directory holding raw ASCII art animations
│ ├── obstacles/ # ASCII arts of obstacles
│ └── ship/ # Spaceship engine flame animation frames
├── curses_tools.py # Core text-processing tools (drawing frames, boundaries)
├── game_config.py # Game configuration file
├── game_state.py # Game state management file
├── controls.py # Non-blocking user keyboard inputs configuration
├── animations.py # Asynchronous game entities behaviors (stars, ship, fire)
├── obstacles.py # Core physics engine managing hitbox rendering and 2D collision detection
├── physics.py # Spaceship inertia, deceleration, and smooth motion physics
└── main.py # Main game setup and orchestration loop
git clone https://github.com/VictoriaL-dev/terminal-space-game.git
cd terminal-space-gamepython -m venv venv
venv\Scripts\activate # on Windows
source venv/bin/activate # on Linux / macOSYou are good to go! Python's standard library includes the curses module by default.
⚠️ Note: The nativecursesmodule is not supported natively on Windows.
To play this game on Windows, you must choose one of the following options:
- Run inside WSL 2 (Recommended):
Open your Linux shell within Windows Subsystem for Linux and execute the project there. - Install Windows Port:
Alternatively, you can patch your Windows python environment by installing the unofficialwindows-cursesport:pip install windows-curses
2. Maximize your terminal size or ensure it is open wide enough to fit the canvas and the ship frames.
python3 main.py▲/▼/◄/►(Arrow Keys): Fly your spaceship smoothly across the night sky.Spacebar: Discharge the plasma cannon.Ctrl + C: Gracefully quit the game loop and return terminal behavior back to normal.