--- description: Core project context for Synthesis — scientific roguelike alwaysApply: true --- # Synthesis — Project Context ## What Is This 2D scientific roguelike (TypeScript + Phaser 3 + bitECS + Vite). Real science replaces magic. Player combines real chemical elements, builds mechanisms using physics, tames creatures through biology, manipulates NPCs via cognitive biases. ## Architecture - **Phaser 3** — rendering, physics, input, audio, scenes - **bitECS** — entity-component-system for game logic (TypedArrays, systems = pure functions) - **Vite** — build + HMR - Phaser handles rendering; bitECS handles logic. They sync via a bridge layer. ## Key Files - `synthesis-gdd.md` — Game Design Document (source of truth for ALL design decisions) - `engine-analysis.md` — Technical stack rationale - `IMPLEMENTATION-PLAN.md` — Phased development roadmap - `PROGRESS.md` — Current status (**update after completing tasks**) ## Design Principles 1. All science must be **real** (simplified, never wrong) 2. Every failed experiment teaches WHY it failed 3. Death is a feature, not punishment — it's a cycle phase 4. Cycles everywhere: gameplay, visuals, audio, narrative 5. Data-driven: game data in `src/data/*.json`, logic in TypeScript