How gaurab-arl/space_war_game works
Space War is a graphics.h arcade game: the player enters a name, navigates the menu, plays a survival-and-scoring loop, and can review saved high scores. The game separates menu/history UI, gameplay, collision and score rules, and file-backed history. The README documents horizontal and descending enemies, player and sky bullets, health, and multiple screens; sampled code supports the main call relationships shown here. Some game-loop details were omitted from the excerpts, so uncertain internal wiring is not shown.
Main entry points: gameui.cpp Game loop · userui.cpp User menu · main.cpp Application entry · collision.cpp Collision handling
Components 16
Entry and screens
- Application entry
main.cpp - Name input
userui.cpp - User menu
userui.cpp - History screen
userui.cpp - Menu click handler
userui.cpp - Space background
assets/deep_space_background.bmp
Gameplay
- Game loop
gameui.cpp - Ship and controls
gameui.cpp - Bullet systems
gameui.cpp - Enemy movement
gameui.cpp
Game rules
- Collision handling
collision.cpp - Health and game over
collision.cpp - Score and level-up
collision.cpp
History records
- History operations
fileop.cpp - Saved scores
history.txt
Other components
- Player
Connections 22
- Player → Application entry: starts game
- Application entry → Name input: requests name
- Application entry → User menu: shows menu
- Player → User menu: clicks
- User menu → Menu click handler: handles clicks
- Menu click handler → Game loop: starts play
- Menu click handler → History screen: opens history
- Player → Ship and controls: keyboard input
- Game loop → Ship and controls: updates and draws
- Game loop → Bullet systems: updates and draws
- Game loop → Enemy movement: moves and draws
- Game loop → Collision handling: checks hits
- Game loop → Score and level-up: updates score
- Collision handling → Health and game over: reduces health
- Collision handling → Score and level-up: awards points
- Health and game over → Game loop: shows game over
- Game loop → History operations: saves score
- History screen → History operations: loads and sorts
- History operations → Saved scores: reads and writes
- User menu → Space background: draws image
- History screen → Space background: draws image
- Name input → Space background: draws image