I'll build a tower defense game with a unique twist. Let me start by exploring the project structure.
Now I'll build CHRONO SPIRE — a tower defense with a unique Rewind & Echo mechanic: rewind time 4 seconds to undo leaks, and every tower spawns temporal echo-clones that fight alongside it. Starting with types and config.
Now the core engine with the rewind/echo time mechanic:
Now the canvas renderer — this defines the game's visual identity:
Now the React UI components:
Now the main App that wires the engine, canvas, and UI together:
Let me build to check for errors:
The build works. Now let me fix a few balance and logic issues I spotted — notably the gold-restore exploit on rewind:
Let me optimize the renderer slightly and add a hover highlight:
Now a dramatic addition: let the player rewind out of death itself — a second chance that fits the mechanic perfectly.
Let me review the engine file for any remaining runtime issues:
I found two real bugs: wave state isn't fully snapshotted (rewinding across a wave start would skip a wave), and splash towers never get kill credit. Fixing both:
Let me add an "incoming wave" preview panel so players can plan their defense:
One final touch — a first-time hint when no towers are built:
CHRONO SPIRE is built and compiling cleanly. 🎮
The unique feature: Rewind & Echo
Press R (or the Temporal Core button) to rewind the battlefield 4 seconds:
- Lost lives return, leaked enemies snap backwards along the path, killed enemies un-die
- Every tower spawns a Temporal Echo — an orbiting ghost clone that fights beside it for 9s (+75% fire rate per stack, stacks 2×)
- Costs 45 Chrono and adds +5% permanent HP to all future enemies (temporal strain), so spamming it digs your own grave
- Gold spent on towers built during the rewound window is not refunded, and bounties from un-killed enemies are revoked — no exploits
- You can even rewind out of death — the "Core Breached" screen offers one last jump upstream (5.6s back) if you banked enough Chrono
A live Temporal Buffer visualizer in the sidebar shows the recorded history, with the erasable 4-second window highlighted in magenta.
The rest of the game
- 5 towers: Bolt Spire (rapid), Frost Coil (slow + splash), Arc Node (chain lightning, hitscan), Siege Mortar (long-range blast), and Chrono Well — a support that dilates time, slowing enemies while hasting nearby towers (thematically tied to the rewind mechanic)
- 6 enemy types incl. slow-immune Phases, armored Bulwarks, and the massive PARADOX bosses; 20 hand-authored waves with an incoming-wave preview panel
- 3 upgrade tiers, selling, call-wave-early scrap bonuses, 1×/2× speed, pause
- Custom canvas renderer: flowing rift road, turret recoil, chain-lightning arcs, splash rings, damage floaters, screen shake, plus a full VHS-style scanline/ghost-trail reverse playback during rewinds
- Procedural WebAudio SFX (no assets) with a mute toggle, and full keyboard controls (1-5, R, U, X, N, F, Esc, Space)
Files built: src/game/types.ts, src/game/config.ts, src/game/engine.ts, src/game/sfx.ts, src/game/render.ts, src/components/Hud.tsx, src/components/Sidebar.tsx, src/components/Overlays.tsx, src/App.tsx, index.html