JRV

Portfolio / CASE STUDY

Public tower defense learning game

Byte Bastion.

A mobile-friendly tower defense game where you write real Python in the browser to unlock towers and waves.

MY ROLE

Independent game, curriculum, and web development

Why it exists

I wanted to get comfortable with Python and interview-style problems. Reading solutions did not make me write code, and a plain problem list was easy to drop.

What I built

I built a static tower defense game with 20 regions of four coding missions each. Finishing a region unlocks waves and new towers, and each mission runs your Python against reference checks in the browser.

Engineering decisions

01

Run Python in a worker

Pyodide loads in a module Web Worker, so a stuck program cannot freeze the page. A 12-second limit stops runaway code, and the next run starts a fresh worker. Standard-library missions then run on the device.

02

Keep the battle deterministic

Enemy movement, targeting, and hits follow a fixed simulation, with Matter.js used only for debris. That let a test win all 21 waves without a person playing. Checkpoints between waves make a retry predictable.

03

Allow help without faking mastery

Hints and solutions let a clear count, and a fresh memory attempt asks for it again. A review queue brings missions back at 1, 3, 7, 14, 30, and 60 days. Progress stays in the browser with JSON export and import.

Capabilities in practice

  • Browser-based code execution
  • Game loop and simulation design
  • Curriculum design with executable tests
  • Mobile-first static web delivery

Status & scope

A personal learning project, hosted as a static site with no account or backend. Passing a mission shows the output was right, not that the solution is efficient. The wave simulation shows a winning defense exists, not that the difficulty is tuned, and it has not had human playtesting. The Python runtime loads from a CDN, so the first run needs a connection. The repository is local only.

KEEP EXPLORING

My Espresso Investment