How ats-xp/atacadao-nightmare works
Atacadão - Nightmare is a C++ 3D first-person shooter built around a small game engine. Its visible runtime starts in source/main.cpp, which initializes SDL and Sokol, dispatches events and frame updates to the active state, and renders that state. The product tree indicates gameplay, map/physics, and 3D presentation subsystems; sampled code confirms texture management, model loading, map parsing, and physics setup. Gameplay wiring beyond the main state loop is inferred from the module layout, so those connections are omitted where caller evidence is unavailable.
Main entry points: main.cpp Runtime loop · model.cpp Model processing · asset_manager.cpp Asset manager · map.cpp Map loading
Components 22
Application flow
- Runtime loop
source/main.cpp - Game state
include/state.hpp - Menu state
source/menu.cpp
Gameplay
- Game state
source/game.cpp - Player character
source/player.cpp - Projectiles
source/bullet.cpp - Dummy actors
source/dummy.cpp - Game objects
include/game_object.hpp
World and rendering
- Map loading
source/map.cpp - Camera
source/camera.cpp - Model processing
source/model.cpp - Mesh rendering
source/mesh.cpp - Render system
source/render.cpp - Billboards
source/billboard.cpp - Sprite animation
source/sprite_anim.cpp
Engine services
- Asset manager
source/asset_manager.cpp - Physics manager
source/physics_manager.cpp - SDL integration
source/sdl2_glue.cpp
Other components
- Player
- Sokol graphics
- PhysX
- Async fetch
Connections 16
- Player → Runtime loop: sends events
- Runtime loop → SDL integration: initializes window
- Runtime loop → Game state: dispatches events
- Runtime loop → Game state: updates and renders
- Runtime loop → Menu state: switches state
- Runtime loop → Game state: switches state
- Runtime loop → Sokol graphics: submits frames
- Map loading → Model processing: loads model
- Map loading → Asset manager: reads map path
- Map loading → Physics manager: sets up collision
- Model processing → Asset manager: loads textures
- Model processing → Mesh rendering: draws meshes
- Model processing → Sokol graphics: submits draw data
- Physics manager → PhysX: simulates scene
- Asset manager → Sokol graphics: creates images
- Asset manager → Async fetch: requests textures