by maciej-trebacz via GitHub · MIT licensed · 17 versions
Open source, kept here so you can read it and make your own copy. Not our work.
Vibe coded Tower Defense type of game made for a game jam
About this project (the project's own write-up)
Tower of Time
Entry for Beginner's Jam Summer 2025
A time-traveling tower defense game where you defend your base against waves of enemies using the power to rewind time.
🎮 Play the game at https://m4v3k.itch.io/tower-of-time

About the game
Tower of Time is a unique tower defense game that combines strategic building with time manipulation mechanics. When enemies overwhelm your defenses, use your time-travel powers to rewind and rebuild your strategy. The game features multiple tower types, energy management, and wave-based enemy spawning.
Key Features
- Time Rewind: Roll back time to survive the enemy waves
- Multiple Tower Types: Basic turrets, sniper towers, slowdown towers, and splash damage towers
- Energy System: Manage energy for building towers and rewinding time
Controls
Game supports both keyboard and gamepad.
- Move: Arrow Keys / Gamepad Analog Stick
- Action: Spacebar / Cross (PlayStation) / A (Xbox)
- Rewind: Backspace / Left Trigger
Vibe Coding Proof of Concept
This game serves as a proof of concept for AI-assisted game development. Approximately 95% of the codebase was written by AI using:
- Augment Code - Advanced codebase context and AI coding assistance
- Cursor - AI-powered code editor, mostly using Agent mode
- Claude Sonnet 4 - My LLM of choice for this project (also used OpenAI o3 and Claude Opus 4 occasionally)
For detailed prompts and development process, see PROMPTS.md.
What I've learned:
- It is entirely possible to develop a game with AI, but you need to know what you're doing
- AI makes prototyping super fast, but as you transition from prototype to final game you need to be careful
- AIs like to write a lot of code, this project could probably have two times less code
- Claude Sonnet 4 knows Phaser.js pretty well but for key areas I've given it a URL to the docs for the specific feature I was working on and it helped
- If the AI gets stuck on something ask it to add debug/console logs and share them with the agent
- If after that it still gets stuck don't fight it, roll back everything and try rephrasing the prompt or giving it more context
Tech Stack
- Engine: Phaser 3 (v3.90.0) with Phaser Editor v4
- Language: TypeScript
- Build Tool: Vite
Development
Requirements
Available Commands
| Command | Description |
|---|---|
pnpm install |
Install project dependencies |
pnpm dev |
Start development server |
pnpm build |
Build for production |
Project Structure
src/
├── main.ts # Entry point and configuration
├── scenes/ # Scenes (Title, Level, Configure)
├── prefabs/ # Prefabs (Player, Towers, Enemies)
├── systems/ # Systems (Energy, Building, Config)
├── components/ # Components (Input, Rewind)
├── ui/ # UI components (Bars, Menus, Dialogs)
└── utils/ # Utilities (Sound, Music, Keys)
public/
├── assets/ # Assets (Images, Sounds, Fonts)
├── style.css # Basic CSS styles
index.html # Game entry point
Credits
- Idea, coding & art: m4v3k
- Balancing, menu music & testing: death_unites_us
- In-game music: Amnesia Fortnight - "A - Spacebase DF-9"
Art Assets
- Space Station-Game asset by jonik9i
- Ocunid Monster by Robocelot
- Void Main Ship by Foozle
- Pixel purple gem by Lunarnia
- Seamless Space Backgrounds by Screaming Brain Studios
- Sounds from freesound.org
License
MIT License - see LICENSE file for details.
Versions (17 — latest: Fix a bug preventing selling towers, re-add removed waves)
- Version 17 — Jul 4, 12:07pm — Fix a bug preventing selling towers, re-add removed waves latest
- Version 16 — Jul 4, 9:13am — Update PROMPTS.md
- Version 15 — Jul 4, 8:49am — Update README.md
- Version 14 — Jul 4, 8:18am — Add rest of the prompts
- Version 13 — Jul 4, 3:35am — Small changes, README and PROMPTS documents
- Version 12 — Jul 3, 5:48pm — Pause enemies during the tutorial dialog box
- Version 11 — Jul 3, 5:23pm — Version 1.0 :D
- Version 10 — Jul 3, 8:38am — Fix hot reload
- Version 9 — Jul 3, 5:46am — Glow effects, update config
- Version 8 — Jul 2, 4:40pm — New tower sprites
- Version 7 — Jul 2, 4:12pm — Added tilemap, fixes
- Version 6 — Jul 1, 4:27pm — Tutorial system, bug fixes
- Version 5 — Jun 30, 4:33pm — More tower types, status bar, various tweaks
- Version 4 — Jun 29, 4:40am — Add runtime configuration
- Version 3 — Jun 29, 4:06am — Title screen, proper loading scene order
- Version 2 — Jun 29, 3:52am — Wave system, congratulations overlay
- Version 1 — Jun 29, 2:47am — Initial commit after 2-3 days of work
Files (106 · 8.5 MB)
- public/37 files · 7.6 MB
- src/51 files · 418.4 KB
- types/1 file · 203 bytes
- vite/2 files · 1.9 KB
- .augment-guidelines291 bytes
- .cursorignore18 bytes
- .cursorrules291 bytes
- .gitignore272 bytes
- GAME.md2.3 KB
- LICENSE1.1 KB
- PROMPTS.md39.8 KB
- README.md4.0 KB
- cover.png296.4 KB
- events.txt210 bytes
- index.html424 bytes
- package.json1.3 KB
- phasereditor2d.config.json161 bytes
- screenshot.png109.2 KB
- tsconfig.json719 bytes
Open a version to see exactly what changed in it, or download the zip for everything.
Get it on your computer
With the Library Mode tool: librarymode get ken/tower-of-time-game
Or tell Claude Code / OpenCode: "get ken/tower-of-time-game from Library Mode"