A top-down 2D action-adventure game built with Phaser 3, TypeScript, and Vite.
The ultimate quest: fight through dungeons, defeat bosses, and claim the legendary Tesla Cybertruck — the top prize hidden in the final dungeon.
# Install dependencies
npm install
# Start dev server (opens browser automatically)
npm run dev| Key | Action |
|---|---|
| Arrow keys | Move (4-direction) |
| Space | Sword attack |
This starter kit gives you a working foundation:
- Player movement — 4-direction with diagonal normalization
- Sword combat — Directional hitbox, knockback, i-frames with blinking
- Enemy AI — Slimes that wander and chase when player is close
- HUD — Heart display that updates on damage, rupee counter
- Game state — Singleton state manager with save/load support
- State machine — Reusable FSM for player and enemy behavior
- Placeholder graphics — Colored rectangles so you can code without waiting for art
Scaffold✅Player movement✅Combat basics✅HUD✅- Tile maps — Install Tiled, create a real map, load JSON
- Room transitions — Doors that change scenes
- Items — Pickups (rupees, hearts, keys)
- Inventory screen — Pause menu
- NPC dialog — Typewriter text boxes
- Dungeon logic — Locked doors, room clearing
- More enemies — Skeleton, Bat
- Save/load — Save points or auto-save
- Boss fight — Final boss guarding the Cybertruck
- Cybertruck victory — Prize reveal scene, end credits
- Polish — Particles, screen shake, sound, music
src/
├── main.ts # Phaser game config
├── config.ts # All constants (speeds, damage, colors)
├── state/GameState.ts # Persistent game state singleton
├── scenes/
│ ├── BootScene.ts # Asset loading + placeholder generation
│ ├── OverworldScene.ts # Main gameplay scene
│ └── UIScene.ts # HUD overlay
└── utils/
├── StateMachine.ts # Reusable finite state machine
└── Direction.ts # Direction enum + vector helpers
The CLAUDE.md file contains full architectural context. Claude Code will read it automatically and understand the project conventions, file structure, and what to build next.
Workflow: pick the next item from the build order → ask Claude Code to implement it → test in browser → commit → repeat.