RogueAsteroid

Classic Asteroids rebuilt in Python: momentum-based flight, particle effects and a component-based entity design

The Game

You’re a ship in an asteroid field. Thrust carefully — momentum carries in space. Shoot a large asteroid and it splits into medium ones; medium ones split into small ones. Clear the wave and the next level gets harder. Survive two levels and you earn an extra life, up to five. The top five scores are saved between sessions.

Architecture

Game objects are entities made of components rather than a deep inheritance tree. Ships, asteroids, bullets and particles share movement, rendering and collision behaviour through composable components (src/core/entities/components.py), so a new behaviour means a new component, not a new subclass.

The rest of the engine is split by responsibility: game state and menus, spawning, scoring, audio, settings and high scores each live in their own module under src/core/.

Particles

Explosions and engine thrust use a small particle system: bursts of short-lived particles with their own position, velocity, lifetime and colour. It is cheap to trigger and makes the game feel much more alive than the bare shapes underneath.

Lessons Learned

Clean structure beats premature optimisation. A Pygame Asteroids clone runs comfortably on modern hardware; what slowed development down was tangled code, not frame rate.

Composition scales better than inheritance, even in a small game. Adding particles, thrust effects and new entity types stayed easy because behaviours were components.

Small arcade games are good teachers. Many of the patterns here — entity composition, separated game state, persisted settings — came back later in rpgCore and RFDGameStudio.


GitHub: RogueAsteroid


Built with Python and Pygame. 221 commits.