How marwahns/game-avoid-the-shuriken works
Project Type and Purpose
• Type: Single-player arcade game implemented in two runtimes:
a) Processing (Java-based .pde files)
b) p5.js (JavaScript browser version)
• Purpose: Provide a playable game (“Avoid The Shuriken”) plus a small static website for docs, download links, and marketing.
File Structure
• Top‐level directories:
• asset/ (fonts, images, sounds used by both game runtimes)
• page/p5/ (browser-based game using p5.js, with Game.js, Menu.js, Ninja.js, Shuriken.js)
• page/web/ (static website pages: index.html, about_us.html, try_game.html, CSS, JS, images)
• processing/ (.pde sketches and properties for the Processing IDE)
• Notable files:
• p5.js library (page/p5/addons/p5.js)
• HTML entry points (page/p5/project/index.html, page/web/index.html, try_game.html)
• Asset types: audio (.mp3), fonts (.vlw), images (various subfolders)
README
• Confirms it’s a Processing game (“Game with processing”), no extra architecture notes.
Main Components & Their Relationships
A. Client Layers
1. Browser (serves static site & p5.js game)
2. Processing IDE / Java Runtime (runs desktop .pde sketches)
B. Static Marketing Website
• HTML/CSS/JS pages under page/web/
• “Try Game” link → page/p5/project/index.html
C. Game Engine Layer
• p5.js library (animation loop, drawing API)
• Processing core (Java-based sketch runner)
D. Game Modules (shared conceptual layer)
• Menu component
• Game logic component
• Ninja entity
• Shuriken entity
E. Asset Store
• Fonts, images, sounds loaded at runtime by both p5.js and Processing
F. Build/Run Scripts (minimal—just the IDE or static file server)
• Browser → fetch static site → load try_game.html → load p5.js → load Game.js modules → request assets → render game to Canvas → user input flow back to Game modules
• Processing IDE → open game.pde → import Menu.pde, Ninja.pde, Shuriken.pde → load assets from asset/ → render to Processing window → user input
Architectural Patterns & Principles
• Separation of Concerns: UI (HTML/CSS/JS) vs. Game Logic (JS/Processing) vs. Assets
• Modular JS: each game class in its own file (Game.js, Menu.js, etc.)
• Polyglot delivery: same assets support two runtimes