How mitklsenpai/sdl_game works
Tuyển VS SDL2 is a third-person survival shooter. The runtime loop in main.cpp coordinates player and weapon updates, enemy movement, collision checks, progression, and rendering; the README also describes tile-map loading, menus/settings, and upgrades. Gameplay separates ordinary enemy waves from the level-three Lich boss, whose attacks use bomb entities. Audio is handled by a dedicated manager. The excerpts establish several loop-to-system calls, but do not show all map, rendering, or menu wiring, so uncertain links are omitted.
Main entry points: main.cpp Game Loop · Collision.cpp Collision System · images Image Assets · Gun.cpp Gun and Bullets
Components 18
Runtime and Interface
- Menus and Upgrades
Game.cpp - Tile Map
Map.cpp - Audio Manager
AudioManager.cpp - Frame Timer
Timer.cpp - Game Loop
main.cpp
Combat and Enemies
- Player Character
MainObject.cpp - Character Base
Player.cpp - Gun and Bullets
Gun.cpp - Collision System
Collision.cpp - Small Enemies
SmallEnemy.cpp
Progression and Boss
- Experience Orbs
SmallEnemy.cpp - Lich Boss
Lich.cpp - Bomb Attacks
Nuke.cpp
Game Assets
- Map Layout
map/map01.dat - Image Assets
images - Sound Assets
sfx
Other components
- Player
- SDL Runtime
Connections 28
- Player → Game Loop: plays
- Game Loop → Frame Timer: starts frame timer
- Game Loop → Player Character: updates
- Game Loop → Gun and Bullets: updates
- Game Loop → Small Enemies: moves
- Game Loop → Collision System: checks collisions
- Game Loop → Menus and Upgrades: applies buffs
- Game Loop → Lich Boss: activates at level three
- Game Loop → Experience Orbs: renders orbs
- Collision System → Gun and Bullets: reads bullets
- Collision System → Small Enemies: checks hits
- Collision System → Player Character: awards score and experience
- Collision System → Experience Orbs: creates and collects
- Collision System → Audio Manager: plays hit sound
- Gun and Bullets → Audio Manager: plays gun sound
- Lich Boss → Bomb Attacks: spawns attacks
- Menus and Upgrades → Player Character: applies upgrades
- Menus and Upgrades → Gun and Bullets: applies upgrades
- Tile Map → Map Layout: loads layout
- Audio Manager → Sound Assets: loads audio
- Player Character → Image Assets: loads textures
- Gun and Bullets → Image Assets: loads textures
- Small Enemies → Image Assets: loads textures
- Lich Boss → Image Assets: loads textures
- Bomb Attacks → Image Assets: loads textures
- Menus and Upgrades → Image Assets: loads textures
- Game Loop → SDL Runtime: uses event and render APIs
- Tile Map → SDL Runtime: renders map