How dannick10/quimpy works
Purpose and Entry Points
Quimpy is a browser-based 2D game built around a p5.js-style sketch loop. The application begins in src/index.html, loads game initialization and frame logic from src/main/sketch.js, and applies page/game presentation through src/style.css.
Runtime and Game Loop
src/main/sketch.js is the orchestration entry point for setup, rendering, and per-frame updates. src/system/p5.js provides the p5 integration boundary, while src/system/preload.js loads game assets before active play. This establishes the browser → p5 runtime → game-loop control flow.
Core Game State and Rules
Game-wide configuration, controls, and gameplay decisions are separated into the system layer:
• src/system/config.js holds shared game parameters/state constants.
• src/system/controls.js maps player input into gameplay actions.
• src/system/gamelogic.js coordinates rules such as collisions, progression, combat, collection, or state transitions.
• src/system/ui.js renders or manages game-facing UI states.
The main loop should invoke these services rather than embedding game rules in individual entities.
Entity Model
The game world is represented by specialized entity modules rooted in src/entities/entity.js. Movement-capable behavior is factored through src/entities/moveentity.js, with concrete world actors including:
• src/entities/player.js for the controllable character.
• src/entities/enemies.js for hostile actors.
• src/entities/blocks.js for terrain or interactive world blocks.
• src/entities/coin.js and src/entities/power.js for collectible/progression items.
Rendering or transient visual behavior is handled by src/entities/animationEntity.js and src/entities/particle.js; card-oriented gameplay is represented by src/entities/card.js.
Primary Flow and Boundaries
Input flows from src/system/controls.js into player/entity updates. Per-frame orchestration in src/main/sketch.js updates movable actors, evaluates gameplay interactions through src/system/gamelogic.js, and renders entities/UI. Entity modules own actor-local state and behavior; the system layer owns cross-entity rules, shared configuration, and UI coordination.
Asset loading is a distinct startup boundary: src/system/preload.js resolves sprites and audio before entities or gameplay depend on them.
Assets and External Dependencies
The runtime targets a browser and relies on p5-related functionality via src/system/p5.js. Visual assets are organized under src/sprites, including enemy and customization resources such as src/sprites/enemy and src/sprites/customization/skin. Audio is local static media under src/sounds, consumed by gameplay and UI events. No backend, database, or external service is indicated by the repository tree.
Main entry points: sketch.js Sketch loop · gamelogic.js Game rules · player.js Player · enemies.js Enemies
Components 17
Browser Runtime
- Game page · Loads the game and page presentation.
src/index.html - Game styles
src/style.css - Sketch loop · Runs setup, frame updates, and rendering.
src/main/sketch.js - p5 integration
src/system/p5.js
Game Systems
- Asset preload · Loads media before active play.
src/system/preload.js - Game config
src/system/config.js - Controls
src/system/controls.js - Game rules · Evaluates cross-entity interactions and state transitions.
src/system/gamelogic.js - Game UI
src/system/ui.js
Entity Model
- Base entity
src/entities/entity.js - Movable entity
src/entities/moveentity.js - Player
src/entities/player.js - Enemies
src/entities/enemies.js - Blocks and pickups · Terrain, coins, and power items.
src/entities/blocks.js - Visual entities · Animations, particles, and cards.
src/entities/animationEntity.js
Connections 27
- Game page → Sketch loop: loads
- Game page → Game styles: applies
- Sketch loop → p5 integration: uses
- Sketch loop → Asset preload: starts with
- Asset preload → Sprites: loads
- Asset preload → Sounds: loads
- Sketch loop → Game config: reads
- Sketch loop → Controls: updates
- Controls → Player: drives actions
- Sketch loop → Game rules: evaluates each frame
- Game rules → Player: applies rules to
- Game rules → Enemies: coordinates
- Game rules → Blocks and pickups: collects and interacts
- Sketch loop → Game UI: renders
- Sketch loop → Player: updates and renders
- Sketch loop → Enemies: updates and renders
- Sketch loop → Blocks and pickups: renders
- Sketch loop → Visual entities: renders
- Base entity → Movable entity: base for
- Movable entity → Player: base for
- Movable entity → Enemies: base for
- Base entity → Blocks and pickups: base for
- Base entity → Visual entities: base for
- Player → Sprites: uses
- Enemies → Sprites: uses
- Game rules → Sounds: triggers
- Game UI → Sounds: triggers