3.6 KiB
Executable File
Princess Lima v2 implementation
Architecture
The rebuild keeps the existing four-chapter story, cast, quest consequences, keyboard-first accessibility, Org publishing entry point, and v1 save. It replaces the static regional backgrounds and single-scene prototype with:
- Boot, preload, title/setup, cinematic intro, region, boss, and ending flows.
- Versioned data contracts for maps, actors, enemies, items, quests, dialogue, cutscenes, assets, interactions, and saves.
- Focused map, state, input-lock, combat, AI, dialogue, camera, audio, save, and accessibility controllers.
- Nine committed Tiled JSON regions with collision, navigation, interaction, transition, spawn, camera, audio, secret, and state layers.
- EasyStar.js 0.4.4 for obstacle-aware paths; Phaser remains the renderer, input, physics, animation, timeline, camera, and effects engine.
Only /play/rpg.html loads the game runtime and its locally hosted assets.
Art direction
The final field style uses 32px terrain, 48×64 four-direction actors, nearest neighbour scaling, dark restrained outlines, warm upper-left lighting, compact shadows, parchment and aged-metal DOM UI, serif display faces, and sans-serif body copy. Regional palettes distinguish the village, woods, ruins, mountain, camp, fortress, throne, and dawn chamber.
tools/generate-princess-lima-v2-assets.py normalizes the field atlas, effects,
palette, transparency, and tile source into deterministic PNG assets. The
portrait contact sheet began as original ImageGen source art and was inspected,
cropped through CSS atlas coordinates, and kept free of generated text. It is
presentation art only and is never used as collision geometry.
Play and story systems
The complete opening-to-rescue arc includes:
- Broken Village production slice, eight enemy roles, four multi-phase bosses, optional discoveries, puzzles, prisoners, fortress defences, and three approach consequences.
- Acceleration movement, normalized diagonals, directional animation, two-hit combo, charged strike, block, active-frame hitboxes, one hit per swing, knockback, recovery, particles, and layered local audio.
- Data-driven conversations with expressions, choices, conditional effects, history, typing controls, camera framing, background focus treatment, and reliable input/focus restoration.
- A skippable, replayable, pausable, narrated introduction with subtitles, title reveal, muted play, and reduced-motion timing.
- Resolved-state flags for all nine regions and an ending that reflects rescued allies and preparation choices.
Saves and accessibility
New progress uses zxh_princess_lima_rpg_v2. The v1 key remains untouched.
Migration validates identity, appearance, chapter, quests, inventory,
equipment, bosses, intro preference, and settings; rejects unknown IDs;
reconstructs derived statistics; and restores to a named safe spawn.
Menus and dialogue remain DOM-backed. They provide keyboard focus, an
aria-live spoken-line mirror, history, instant completion, choice navigation,
subtitles, narration toggle, text speed, high contrast, reduced motion,
particles, lighting, shake, blur, and effects-quality controls. Canvas and
blur-disabled modes retain dimming and actor depth separation.
Validation
Automated coverage lives in tests/princess-lima-*.test.cjs and checks schemas,
map contracts and reachability, dialogue effects, cutscene cleanup, input
restoration, quests, movement/combat phases, hitbox rules, AI transitions,
boss phases, v1 migration, invalid-data recovery, and accessibility settings.
Publishing remains covered by the Emacs and clean Org-build suites.