⚔️ Our Story

About Castle Defender

A handcrafted browser game born from a love of medieval strategy and the raw power of modern web APIs — no engines, no frameworks, just code.

What is Castle Defender?

Castle Defender is a browser-based tower defense game in which you protect your castle from endless waves of knights, goblins, and increasingly fearsome enemies. Click to shoot, spend gold on towers and armour, and see how many levels you can survive.

Every visual element — the castle, enemies, bullets, particles, and HUD — is drawn in real time on an HTML5 Canvas. Sound effects are synthesised live through the Web Audio API. There is nothing to install, no account to create, and no third-party game engine involved.

✦

What Makes It Tick

🎨

Pure Canvas Rendering

Every frame is drawn from scratch using the Canvas 2D API — no sprite sheets, no external assets.

🔊

Web Audio Synthesis

Shooting, explosions, and level-up fanfares are generated procedurally using oscillators and gain envelopes.

📈

Infinite Scaling

Enemy health and spawn rate scale each level, so the challenge never plateaus.

🏆

Local High Score

Your personal best is saved to localStorage — no server, no account, just your browser.

📱

Responsive Layout

The game shell scales to fit any screen width, from desktop monitors to mobile browsers.

⚡

Zero Dependencies

No React, no Vue, no game engine. Pure HTML, CSS, and vanilla JavaScript from top to bottom.

✦

Technology Stack

The entire project runs as a FastAPI application serving Jinja2 templates. The game itself uses no front-end libraries whatsoever — everything you see and hear is native browser API.

Python 3 FastAPI Jinja2 HTML5 Canvas Web Audio API Vanilla JS CSS Variables localStorage

The project started as a Pygame desktop game and was ported to the browser, preserving the original game logic — enemy types, difficulty scaling, tower placement, and the repair / armour economy — while replacing every rendering and audio call with its web equivalent.

Ready to Defend?

Your kingdom won't protect itself. The first wave is already marching.

⚔️ Play Now