How phimie/cryprawl works
Project Type and Purpose
• Cryprawl is a desktop arcade-style game built on Pygame.
• It’s structured as a single-process application with modules for entities, game loop orchestration, asset management, and packaging.
Major Components to Model
a. Game Core
– Cryprawl.py (main entrypoint)
– settings.py (configuration loader)
– rpath.py (resource-path helper)
b. Entity Modules
– ship.py, bullet.py, enemy.py, bat.py, Batmage.py, button.py
– These define classes, behaviors, collision logic.
c. Asset Management
– assets/audio/… (effects, music, UI sounds)
– rpath.py helps locate these at runtime.
d. Input Handler
– Integrated in Cryprawl.py’s event loop (keyboard/mouse events → entity actions)
e. Renderer
– Pygame display subsystem invoked by Game Core
– Draws sprites, backgrounds, UI layers in each frame
f. Physics & Collision
– Entity update() methods compute positions, detect overlaps, resolve collisions
g. Audio Manager
– Loads and plays sounds via Pygame.mixer API
h. Packaging & Distribution
– dist/ folder containing PyInstaller-generated executables (Cryprawl-v0.0.4-alpha.1.exe, SkyForce versions)
– compiler_directive.md documents build flags
Relationships and Data Flows
• User Input → Game Core (Cryprawl.py event loop)
• Game Core → Entity Modules.update() → Physics & Collision → Entity state changes
• Game Core → Audio Manager.play() on events
• Entity Modules ↔ Asset Management (load images/audio via rpath.py)
• Build Scripts (PyInstaller) → Executable in dist/
Architectural Patterns & Principles
• Central Game Loop (Single-threaded main loop)
• Modular Entities (each game object encapsulates its own logic)
• Resource Abstraction (rpath.py + settings.py centralize config & asset paths)
• Separation of Concerns: input, update, render, audio handled in distinct subsystems