How perhapseb/chromajump works
Project type & purpose (from README + file tree)
This project is a static, browser-delivered 2D pixel-art platformer (“ChromaJump”) built with p5play (game framework on top of p5-style rendering/physics/sprites) and q5.js (rendering/utility). It’s intended to run on GitHub Pages (link in README), so there’s no backend; everything is client-side.
From the tree:
• index.html, style.css, sketch.js → classic single-page p5/p5play-style game structure (HTML host, CSS page styling, JS “sketch” containing game loop).
• Images/, Spritesheets/, Sounds/, Music/ → packaged game assets.
• No bundler/config (package.json, vite, etc.) → likely CDN script tags and direct asset loading.
File-structure-to-architecture mapping (what each folder “means”
Top-level components implied by the structure:
Runtime / app shell
• index.html
Entry point. Loads libraries (p5play/q5.js), loads sketch.js, links style.css, defines canvas container.
• style.css
Presentation around the canvas (page layout, maybe scaling / centering).
• sketch.js
The “game executable”: initialization, main loop, scene/level logic, collision rules, lens switching, UI, and asset references.
Assets (immutable content)
• Images/ (including Images/Parallax/)
Backgrounds, parallax layers, UI images, etc.
• Spritesheets/
Animated sprite atlases for player/enemies/platforms.
• Sounds/ and Music/
SFX and ambient music.
What to infer from the README (key gameplay modules to show)
The README describes a core mechanic:
• Lens system (Red/Green/Blue): platforms are visible/active only when the current lens matches.
• Progression: lenses unlock over time; levels get harder.
• Input: keyboard + gamepad support.
Browser ← GitHub Pages: returns HTML
4. Browser → GitHub Pages: GET style.css, sketch.js, library scripts, and assets on demand
index.html → (loads) sketch.js + libs
Runtime initialization
Game Runtime → Engine (p5play/q5): initialize canvas, sprites, physics world
Per-frame gameplay loop
Physics/Collision → Player/Entities: resolves collisions & triggers events
11. Events (jump, land, lens swap, level complete) → Audio Manager → WebAudio (plays SFX/BGM)
12. Game Loop → Renderer (q5/p5play) → Canvas: draws current frame (including parallax layers)
Progression
Architectural patterns / principles (what’s important here)
Even in a single JS file, this kind of p5play game usually follows:
• State machine / scene management: menu → level → win/lose → next level.
• Client-only deployment: no server logic; all content shipped as static assets.
• The lens mechanic as a controller that affects both rendering (visible) and physics/collision (solid/interactive).
• The asset pipeline (preload + runtime use), because asset folders dominate the project structure.
Relevant technologies & frameworks (explicitly
• Browser APIs: Canvas, WebAudio, Gamepad, Keyboard
• Frameworks: p5play, q5.js
• Hosting: GitHub Pages
• Asset formats: .mp3, .wav, sprite sheets (PNG/WebP depending on your assets)
“Don’t overthink it”: maximal component separation that still matches reality
• Bootstrapping
• Asset loading
• Input mapping (keyboard + gamepad)
• Level/scene management
• Entity + physics + collisions
• Rendering (including parallax)
• Audio (music + SFX)
That’s the “as many components as possible” breakdown that remains accurate to this project’s purpose and structure.