Skip to content

Latest commit

 

History

History
169 lines (124 loc) · 5.61 KB

File metadata and controls

169 lines (124 loc) · 5.61 KB

Architecture Guide

Use this file if you want to understand how the repo is organized before editing it.

What This Repo Optimizes For

The project is split for two reasons:

  • readable enough to teach from
  • easy enough to fork for new lessons, creatures, art, and maps

That is why most of the game still lives in plain ES modules and plain data objects instead of heavier framework structure.

Read Order

If you are new to the repo, read files in this order:

  1. README.md
  2. CONTENT_GUIDE.md
  3. src/content.js
  4. src/drills.js
  5. src/game.js
  6. src/game-run-runtime.js
  7. src/game-world-helpers.js
  8. src/game-motion-runtime.js

That path gets you to editable surfaces first, then the orchestration layer.

Module Ownership

Common Change Recipes

Add a creature

Touch:

Then run:

npm run build:assets

Add a lesson

Touch:

Add a map

Touch:

Recolor characters

Touch:

Change sprite art

Touch:

Then run:

npm run build:assets

Change leaderboard or hosting behavior

Touch:

Why game.js Still Exists

src/game.js is still the top-level glue file. That is intentional.

It owns:

  • startup
  • dependency wiring
  • high-level progression
  • overworld interaction routing
  • mode transitions
  • render loop
  • browser input registration

Lower-level systems already live in battle.js, battle-flow.js, battle-techniques.js, battle-enemy.js, battle-challenge-runtime.js, drill-runtime.js, input.js, state.js, scenes.js, game-run-runtime.js, game-world-helpers.js, and game-motion-runtime.js. Most contributors should not need to touch game.js unless they are changing progression rules, render wiring, or connecting systems together.

What To Avoid

  • do not put new content directly into game.js if it can live in src/content.js or src/drills.js
  • do not merge systems back together just because one file feels easier in the moment
  • do not hide simple editable data behind unnecessary helper layers

Validation

Before opening a PR:

npm run build:assets
npm test
npm run lint
npm run check
npm run smoke

For gameplay or UI changes, also use TESTING.md.