Mana towers in HTML and Typescript.
Find a file
2026-02-13 00:05:20 +00:00
src some random favicon 2026-02-12 23:52:39 +00:00
.editorconfig formatting 2026-02-12 20:27:20 +00:00
.gitignore init 2026-02-12 18:34:31 +00:00
.oxlintrc.json formatting 2026-02-12 20:27:20 +00:00
.prettierignore formatting 2026-02-12 20:27:20 +00:00
.prettierrc ui cleanup and fixed prettier for svelte, and formatting 2026-02-12 23:11:35 +00:00
AGENTS.md agents.md and readme.md 2026-02-12 23:26:09 +00:00
bun.lock ui cleanup and fixed prettier for svelte, and formatting 2026-02-12 23:11:35 +00:00
bunfig.toml svelte 2026-02-12 21:00:26 +00:00
CLAUDE.md formatting 2026-02-12 20:27:20 +00:00
package.json ui cleanup and fixed prettier for svelte, and formatting 2026-02-12 23:11:35 +00:00
README.md Update README.md 2026-02-13 00:05:20 +00:00
tsconfig.json typescript 2026-02-12 19:59:36 +00:00

Mana Towers

Mana Towers is a browser-based tower-defense prototype built with Bun + Svelte 5. Build generators and batteries, route mana beams, place towers, and survive all waves.

A conversion to Godot is planned at some point in the future (the initial prototype was in Godot, but it was horrendous).

This is inspired by a warcraft 3 map called Power Towers

Tech Stack

  • Runtime and tooling: Bun
  • UI: Svelte 5 (runes mode)
  • Routing: sv-router
  • Styling: Tailwind CSS v4
  • Tests: bun test

Getting Started

1) Install dependencies

bun install

2) Run in development

bun run dev

Open the local URL printed by Bun.

Scripts

  • bun run dev - Start dev server with watch mode
  • bun run start - Start server
  • bun run check - TypeScript + Svelte diagnostics
  • bun run lint - Prettier check + oxlint
  • bun run format - Format files with Prettier
  • bun test - Run gameplay/unit tests

How To Play (Current Controls)

Command Grid

  • Use hotkeys: QWER, ASDF, ZXCV
  • Build mode: select a build card, then click a valid tile
  • Hold Shift while placing to keep build mode active

Global Controls

  • Space - Start wave immediately
  • P - Toggle path visibility
  • N - Generate a new seed (new map, URL updates)
  • M - Restart current seed
  • Escape - Clear selection and active cursor action

Seed URLs

  • Open /123456 to play a specific seed.
  • The active seed is shown in the HUD stats.
  • When a seed changes (for example N for a reroll), the path updates so the run can be shared by URL.

Selection

  • Click building to select
  • Drag-select multiple buildings
  • Shift + drag to add to selection
  • Double-click a building to select all of same type/tier

Project Structure

src/
  game/
    config.ts        # gameplay constants and building definitions
    map.ts           # map generation
    pathfinding.ts   # walkability/path search
    gameState.ts     # simulation and state transitions
    controller.ts    # input orchestration + command panel composition
    renderer.ts      # canvas rendering
    *.test.ts        # gameplay/unit tests
  ui/
    components/      # Svelte UI components
    game-ui-store.ts # bridge from controller snapshots to UI
  routes/            # route components
  server.ts          # Bun server routes

Roadmap

  • Add a dedicated seed panel with copy/share and quick reroll actions.
  • Add "set seed" input/action so players can replay specific maps without editing the URL.
  • Add richer wave/enemy variety and clearer wave previews.
  • Add more towers/upgrades and deeper mana-beam strategy options.
  • Add save/load for local runs and build experimentation.

Contributing Notes

  • Keep game logic in src/game/* and UI rendering in src/ui/*.
  • Prefer Bun-first commands and tooling.
  • For UI changes, run bun run check.
  • For game logic changes, run bun run check and bun test.

See AGENTS.md for full AI-agent contribution rules and validation guidance.