5.3 KiB
5.3 KiB
Project Context
Quick reference for agents to restore context. Updated after significant actions.
Project Summary
Type: Roguelite platformer (browser-based) Tech Stack: Phaser 3 + TypeScript + Vite Current Phase: Phase 1 - Core Loop (in progress)
Key Documents
| Document | Purpose |
|---|---|
CLAUDE.md |
Agent instructions, project structure |
docs/REQUIREMENTS.md |
Full game design, mechanics, upgrades |
docs/ARCHITECTURE.md |
Technical architecture, patterns, interfaces |
docs/ROADMAP.md |
Development phases, task checklists |
docs/CONTEXT.md |
This file - action log for agents |
Core Mechanics (Quick Reference)
- One-hit kill platformer (by default)
- Stun projectiles - 3 max, 3s cooldown each, stun enemies for 3s
- Collect all coins to complete level
- GasCoins - meta-currency earned from collected coins
- Shop - buy upgrades between runs
- Procedural generation - Spelunky-style room grid (4x4)
Game Feel Constants
Coyote Time: 100ms
Input Buffer: 100ms
Edge Correction: 4px
Stun Duration: 3s (base)
Projectile Cooldown: 3s (base)
Max Projectiles: 3 (base)
Action Log
2025-01-17
Phase 1 Core Implementation Started
-
Project Initialized
- Vite + TypeScript + Phaser 3 configured
package.json,tsconfig.json,vite.config.tscreated- Path aliases (
@/) configured
-
Config Files Created
src/config/game.config.ts- Phaser config (1280x720, Arcade Physics)src/config/physics.config.ts- Movement speeds, gravity, timingssrc/config/controls.config.ts- Key bindings, game feel constantssrc/config/balance.config.ts- Scoring, level progression, spawn rates
-
Type Definitions Created
src/types/game-state.ts- RunState, MetaState interfacessrc/types/entities.ts- Enemy, Hazard, Player configs
-
Base Scenes Implemented
BootScene- Initializes registry with statePreloadScene- Generates placeholder texturesGameScene- Core gameplay with test levelUIScene- HUD (coins, projectiles, score)GameOverScene- Death screen with stats, GasCoin conversion
-
Entities Implemented
Player- Movement, jump with game feel (coyote time, input buffer, variable jump)Enemy- Patroller with stun mechanic, visual indicatorCoin- Collection with animationProjectile- Firing and collision
-
Core Systems Working
- Player movement with responsive controls
- Projectile system with cooldowns
- Enemy stunning with timer
- Coin collection and level completion
- Death/restart cycle
- HUD updates
- GasCoin earning on death
- LocalStorage save/load
2025-01-16
Documentation Phase Complete
- Created
docs/ARCHITECTURE.md - Created
docs/ROADMAP.md - Created
docs/CONTEXT.md
Current State
[x] Requirements defined (REQUIREMENTS.md)
[x] Architecture designed (ARCHITECTURE.md)
[x] Roadmap created (ROADMAP.md)
[x] Project initialized (Vite + Phaser + TS)
[x] Config files created
[x] Type definitions created
[x] Base scenes implemented
[x] Player with game feel
[x] Patroller enemy with stun
[x] Coins and collection
[x] Projectile system
[x] Basic HUD
[x] Game Over with GasCoins
[ ] Particles and visual juice
[ ] Audio system
[ ] Shop scene
[ ] More enemy types
[ ] Procedural level generation
Project Structure (Current)
src/
├── main.ts # Entry point
├── vite-env.d.ts # Vite types
├── config/
│ ├── game.config.ts
│ ├── physics.config.ts
│ ├── controls.config.ts
│ └── balance.config.ts
├── types/
│ ├── index.ts
│ ├── game-state.ts
│ └── entities.ts
├── scenes/
│ ├── BootScene.ts
│ ├── PreloadScene.ts
│ ├── GameScene.ts
│ ├── UIScene.ts
│ └── GameOverScene.ts
└── entities/
├── Player.ts
├── Enemy.ts
├── Coin.ts
└── Projectile.ts
Next Actions
- Add particles (dust, stun stars, coin sparkle)
- Add screen shake options
- Add basic sound effects
- Implement ShopScene
- Add more enemy types (Jumper, Flyer)
- Implement procedural level generation
Commands
npm run dev # Start dev server (http://localhost:3000)
npm run build # Production build
npm run preview # Preview production build
Key Decisions Made
| Decision | Rationale |
|---|---|
| Phaser 3 Arcade Physics | Simple, performant, good for platformers |
| Dual-state pattern | Clean separation of run vs persistent data |
| Placeholder textures | Quick iteration, real assets later |
| Registry for state | Shared state between scenes |
| Arrow function callbacks | Cleaner collision handling |
Known Issues
- None critical at this point
How to Use This File
For agents starting work:
- Read this file first for quick context
- Check "Current State" for project status
- Check "Next Actions" for immediate tasks
- Read relevant docs (ARCHITECTURE.md, ROADMAP.md) as needed
After completing work:
- Add entry to "Action Log" with date
- Update "Current State" checkboxes
- Update "Next Actions" if changed
- Note any "Known Issues" discovered