How freeza222/my_hunter works
My Hunter is a CSFML duck-shooting game. The player enters through the menu, starts play, shoots moving ducks to score, and manages lives until game over, with restart available. Runtime ownership is centered on the main loop, which dispatches input, updates gameplay, and draws screens; initialization and cleanup support that flow. README capabilities include audio, animated multiple ducks, difficulty, crosshair, and lives. Source excerpts establish most call edges; unsampled details are represented only where documented.
Main entry points: main.c Game Loop · init.c Game Initialization · update.c Duck Movement · draw.c Screen Rendering
Components 13
Game Runtime
- Game Loop
src/main.c - Input Events
src/event.c - Game Initialization
src/init.c - Resource Cleanup
src/destroy.c
Gameplay
- Duck Movement
src/update.c - Duck and Dog Setup
src/init_entities.c - Hit and Menu Logic
src/event.c - Score and Lives
src/update.c
Presentation
- Screen Rendering
src/draw.c
Assets and State
- UI and Audio Setup
src/init_assets.c - Sprites and Background
src/init.c
Utility Library
- C Utility Library
lib/my/my.h
Other components
- Player
Connections 19
- Player → Game Loop: starts game
README.md - Game Loop → Game Initialization: initializes
src/main.c - Game Loop → Input Events: dispatches events
src/main.c - Game Loop → Duck Movement: updates gameplay
src/main.c - Game Loop → Screen Rendering: draws frame
src/main.c - Game Loop → Resource Cleanup: cleans up
src/main.c - Input Events → Hit and Menu Logic: handles clicks
src/event.c - Hit and Menu Logic → Duck Movement: resets duck
src/event.c - Hit and Menu Logic → Score and Lives: updates score
src/event.c - Duck Movement → Score and Lives: decrements lives
src/update.c - Game Initialization → UI and Audio Setup: sets up assets
src/init.c - Game Initialization → Duck and Dog Setup: initializes entities
src/init.c - Game Initialization → Sprites and Background: creates background
src/init.c - Screen Rendering → Score and Lives: renders score lives
src/draw.c - Screen Rendering → UI and Audio Setup: renders UI assets
src/draw.c - Duck Movement → C Utility Library: formats score
src/update.c - Player → Input Events: shoots and restarts
README.md - Player → Screen Rendering: views game
- UI and Audio Setup → Duck and Dog Setup: loads audio