How debugdwrld/zero-to-hero-z2h works
Z2H is a Pygame action game. The player starts in the hall, moves and fights through levels, collects batteries, and returns to use the hall’s battery storage and property-tree menus; the main loop coordinates play and the renderer presents the result. Combat, player progression, level/world representation, and hall interactions are distinct runtime concerns. README also describes skills, energy, HUD, and level switching. Some main-loop wiring and unsampled modules are not shown, so uncertain links are omitted.
Main entry points: main.py Game loop · bullet.py Projectile combat · initial.py Game initialization · render.py Rendering and HUD
Components 14
Game runtime
- Game loop
main.py - Game initialization
initial.py
Combat and player
- Player state
player.py - Projectile combat
bullet.py - Enemy behaviors
enemy.py - Gameplay constants
constants.py
World and progression
- Level layout
world_beta.py - Procedural world
world.py - Start hall
starthall.py
UI and assets
- Interaction menus
menu.py - Rendering and HUD
render.py - Image loading
load.py - Game images
Images
Other components
- Player
Connections 18
- Player → Game loop: controls
- Game loop → Game initialization: initializes via
- Game initialization → Image loading: loads images
- Image loading → Game images: reads assets
- Game initialization → Player state: creates
- Game initialization → Start hall: creates
- Game loop → Projectile combat: updates projectiles
- Game loop → Rendering and HUD: requests drawing
- Game loop → Interaction menus: dispatches events
- Interaction menus → Player state: updates inventory and skill
- Interaction menus → Start hall: transfers batteries
- Projectile combat → Player state: uses energy and awards XP
- Projectile combat → Enemy behaviors: checks hit types
- Projectile combat → Gameplay constants: reads combat settings
- Player state → Gameplay constants: reads movement setting
- Rendering and HUD → Projectile combat: draws projectiles
- Rendering and HUD → Start hall: draws hall
- Rendering and HUD → Level layout: reads level metadata