index.htmlboots the canvas game;styles.csshandles base styling.src/main.jswires the ECS world and registers systems.ecs/defines the world, components, and base system class.systems/hosts input, physics, collision, camera, render, parallax, and combat logic—add new runtime behavior as a system rather than inline loops.core/holds math/events helpers;loaders/manage tilemaps and actors;render/includes overlays and sprite drawing;entities/provides factories;world/contains infinite-world helpers.assets/stores Tiled JSON maps (assets/levels), sprites/backgrounds (assets/sprites,assets/background), and tileset definitions. Keep new content organized by type and map name.docs/holds supplementary guides;scripts/contains optional asset tooling (conda/webui) not required for running the game.
python -m http.server 8000(run from repo root) — serve the game locally; openhttp://localhost:8000and loadindex.html.npx http-server— alternative static server if Node is available.initial_setup.sh— optional helper for repo bootstrap; review before running. No bundling step exists; reload after asset or map changes.
- ES modules with
const/let; 2-space indentation; keep semicolons as used throughout the codebase. - File names use kebab-case (
camera-system.js,tilemap-loader.js); classes in PascalCase; components and systems exported explicitly. - Centralize tunables in
src/config.jsand diagnostics insrc/debug.js; avoid magic numbers in systems by extending those configs. - Keep systems single-responsibility and data-driven; prefer component flags and config constants over hard-coded branches.
- No automated suite yet; rely on manual smoke tests:
- Serve locally, confirm player spawn, movement, jump, camera follow, and collision.
- Toggle debug overlays (
F1metrics,F2hitboxes,F3slow-mo,F4grid, backtick pause) when validating new behavior.
- When adding assets or levels, load them in-game to check sprite origins, animation timing, and collision alignment.
- Use conventional commits seen in history (
feat(tilemap): …,fix(collision): …); scope by module or system name. - PRs should include: brief behavior summary, affected assets/maps, manual test notes, and screenshots/GIFs for visual changes.
- Link issues or milestones when relevant; keep branches focused on one feature or fix per PR.