How teytra/2.5d_shooter_game works
This is a single-file, real-time terminal FPS. The player enters through platform-specific raw keyboard handling; the game loop applies movement, firing, and reload actions, updates the encounter, then renders the view and HUD to the terminal. The gameplay stages include map-based movement and collision, bot pursuit and attacks, player combat and scoring, and win/loss state. Rendering combines DDA wall casting with depth-tested bot sprites. The README documents these capabilities, but the source excerpt omits parts of the loop and bot update code, so uncertain call wiring is not shown.
Main entry points: main.c Game entry and loop
Components 13
Runtime and input
- Game entry and loop
main.c - Raw input
main.c - Action controls
main.c
Gameplay systems
- Map and collision
main.c - Bot AI
main.c - Combat and reload
main.c - Win and loss
main.c
Terminal presentation
- Wall raycasting
main.c - Bot sprites
main.c - HUD and crosshair
main.c
Game state
- Player and game state
main.c
Other components
- Player
- Terminal display
Connections 17
- Player → Raw input: presses keys
- Game entry and loop → Raw input: polls input
- Raw input → Action controls: dispatches keys
- Action controls → Player and game state: updates actions
- Action controls → Map and collision: checks movement
- Action controls → Combat and reload: fires or reloads
- Bot AI → Map and collision: checks line of sight
- Bot AI → Player and game state: updates health
- Combat and reload → Player and game state: updates ammo and score
- Player and game state → Win and loss: determines result
- Game entry and loop → Bot AI: updates bots
- Game entry and loop → Wall raycasting: renders view
- Wall raycasting → Bot sprites: provides depth buffer
- Game entry and loop → HUD and crosshair: renders status
- Wall raycasting → Terminal display: draws scene
- Bot sprites → Terminal display: draws bots
- HUD and crosshair → Terminal display: draws HUD