overrun/CLAUDE.md

2.1 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a Phaser 3 HTML game (Smash TV-style top-down arena shooter) built with vanilla JavaScript and ES6 modules. No build tools or bundlers are used — the game runs directly in the browser.

Running the Game

Since there is no bundler, serve the files with a local HTTP server (ES6 modules require HTTP, not file://):

npx serve .
# or
python3 -m http.server 8080

Then open http://localhost:8080 (or whatever port) in a browser.

Tech Stack & Constraints

  • Phaser 3 (loaded via CDN or local script tag)
  • Vanilla JavaScript with ES6 import/export — no bundler (Webpack, Vite, etc.)
  • 1280x720 canvas, scaled to viewport
  • Vector graphics placeholder art (no sprites required initially)

Architecture

Module Structure

Files use ES6 import/export directly. Each major concern lives in its own file/class and is imported where needed. Keep things modular so zones, enemies, and skills can be added without touching core logic.

Scenes

  • IntroScene — main menu / title screen
  • GameScene — core gameplay loop (zones, waves, player, enemies)
  • GameOverScene (or overlay) — shown when all lives lost; press R to return to menu

Game Loop Concepts

  • Zones contain sequential waves of enemies; waves escalate in difficulty and enemy variety per zone
  • Player: 3 lives, 100 HP per life; WASD movement; mouse-aimed rotation (fixed turn rate); left-click fires
  • XP & Leveling: enemies drop XP; level-up pauses the game and shows the skill tree UI

Skill Tree

  • Defined in JSON so it can be extended without code changes
  • Branching structure; current root branches:
    • Defense → Take 10% less damage
    • Offense → Increase damage by 20% OR Increase fire rate by 40%
  • On level-up, pause game and present available skill choices to the player

Enemy Design

  • Enemies increase in difficulty and attack variety with each zone
  • Each enemy type should be its own class/file for easy extension