A compact, single-player Asteroids-style game implemented in Python.
This repository contains a simple implementation of the classic Asteroids game. It provides the game loop, player ship, asteroids, and shots. It is designed to be small and easy to read — suitable for learning or modest extension.
- Python 3.8 or newer
- No external dependencies required (standard library only). If you add third-party packages, update
pyproject.tomlaccordingly.
From the project root run:
python main.pyIf you want to run a single file directly for testing, the main entry is main.py.
- Move / rotate: arrow keys or WASD (depending on implementation in
player.py) - Fire: space (see
shot.py) - Quit: usual terminal/window close or interrupt (Ctrl+C)
Note: Controls are implemented in the code and may vary slightly; consult main.py and player.py for exact key bindings.
main.py- game entry point and main loopasteroid.py- asteroid entity and behaviorasteroidfield.py- collection manager for asteroidsplayer.py- player ship logic and input handlingshot.py- projectile logiccircleshape.py- simple circle collision/shape helpersconstants.py- shared constants and configurationlogger.py- lightweight logging helper used by the projectgame_state.jsonl,game_events.jsonl- example runtime logs / event streams