How edds018/galaxy-rush works
Galaxy Rush is a single-file SDL2 arcade game: the player controls Shion, fights increasingly difficult enemies, and earns points across game phases. The principal workflow is keyboard/event handling during a phase, movement and shooting, enemy-hit resolution, and score updates. These responsibilities are implemented together in Galaxy/v2.c rather than separate modules. The excerpts show phase event polling, bullet setup and firing, enemy movement and hit handling, and explosion playback; the README supplies the game premise and SDL runtime requirements. Other internal boundaries are inferred from the monolithic file, not inspected in full.
Main entry points: v2.c Bullets and hits · explosao.wav Explosion sound
Components 9
Gameplay
- Player controls
Galaxy/v2.c - Game phases
Galaxy/v2.c - Enemy behavior
Galaxy/v2.c - Bullets and hits
Galaxy/v2.c - Score updates
Galaxy/v2.c
SDL Runtime
- SDL event loop
Galaxy/v2.c - Sound playback
Galaxy/v2.c
Game Assets
- Explosion sound
Galaxy/explosao.wav
Other components
- Player
Connections 8
- Player → SDL event loop: provides input
Galaxy/v2.c - SDL event loop → Game phases: dispatches events
Galaxy/v2.c - Game phases → Enemy behavior: moves enemies
Galaxy/v2.c - Game phases → Bullets and hits: handles firing
Galaxy/v2.c - Bullets and hits → Enemy behavior: checks hits
Galaxy/v2.c - Bullets and hits → Score updates: awards points
Galaxy/v2.c - Bullets and hits → Sound playback: plays effect
Galaxy/v2.c - Sound playback → Explosion sound: uses sound