Compile & Defend artwork$4.9950%2 user reviews

Compile & Defend

A tower defense game where you don't click to shoot — you write code your towers run every tick, in Python, JavaScript, C++, C#, Rust, Zig or Lua. Prioritize threats with if, sweep swarms with for, and route air, armor and camo to the right tower. Better algorithms beat more towers.

Screenshots

From the Steam store

You don't place towers. You program them.

Compile & Defend is a tower defense game with no click-to-shoot. Every tower on the field runs your code, once per tick. Write a smarter script and your defense gets smarter — write a sloppy one and the swarm walks right through.

It's the tower defense game for people who'd rather refactor than micromanage.

Write it in your language

There's no proprietary scripting dialect to learn. You write in a clean subset of a real language you already know — pick from Python, JavaScript, C++, C#, Rust, Zig, or Lua. They all compile to the same engine; the language only changes how your code is spelled. Switch anytime.

How it plays

Your program is bound to each tower every tick — me is the tower, me.enemies_in_range is what it can see, me.shoot(target) pulls the trigger. From there it's all you!

The closest enemy isn't always the most dangerous one — so the naive shoot the first thing you see script will always get you started, and never win. Better algorithms beat more towers.

Features

Code-driven combat — a real (but safe) interpreter runs your script. Clear, line-numbered errors, because debugging is half the genre. A teaching campaign — a seven-stage tutorial walks you from your first shoot to full for-loop swarm control, introducing each threat one step before the tool that beats it. 13 campaign maps across three tiers. Easy / Normal / Hard — harder modes are tougher and longer, pushing you into scaled freeplay for the medal. Earn up to three stars per map, including a bespoke coding challenge that rewards a genuinely better algorithm, not just more gold. Ten distinct towers — Arrow, Cannon, Tesla, Sniper, Frost, Venom, Support, Mortar, Chain and Detect, each with its own API: slow enemies, poison them, buff allies, lob splash at a point, chain lightning through a cluster, or reveal camo for your other towers. Eight threats to route around — fast Runners, flying Flyers, armored Brutes, camo Shades, swarming Spawnlings, self-splitting Broods, and the nested Titan boss. Build and share your own levels — draw a map, draft its waves, and share it with a single copy-paste code. An auto-balancer certifies every level is beatable and code-mandatory before you play. Sandbox mode — infinite gold, every enemy on tap, hot-swap your code live. Prototype a controller, break it, fix it.

Everything is deterministic, so a script that wins today wins tomorrow.

Write once. Compile. Defend.

Games like Compile & Defend

See all
CodeWar Kingdom

CodeWar Kingdom

Say goodbye to micromanagement and embrace strategic programming!

50% of 2 Steam reviews are positive$8.99
Code: Terraform

Code: Terraform

Write scripts that run rovers, power grids and drone fleets on a frozen planet, and watch your colony grow as the world starts answering back.

84% of 381 Steam reviews are positivePlayers online now: 79$14.99
Screeps: Arena

Screeps: Arena

You write JavaScript, your units follow it, and the arena decides whose logic was better.

82% of 107 Steam reviews are positivePlayers online now: 10$13.39
Code Has Price

Code Has Price

Collect and buy commands. Construct program from them. Run code to get more coins and commands. Repeat.

78% of 9 Steam reviews are positive$3.99
PYTHON:KINGDOM WARS

PYTHON:KINGDOM WARS

Command six unit types with Python and fight real-time wars against AI large language models. Write code. Build tactics.

100% of 1 Steam reviews are positive$1.99
Net.Attack() - Code or Die!

Net.Attack() - Code or Die!

CODE OR DIE! Hack enemy systems & survive the security response by engineering lethal bullet-heaven algorithms.

80% of 514 Steam reviews are positivePlayers online now: 1$7.99
You Are The Code

You Are The Code

A programming puzzle game, but YOU CAN'T TYPE. Navigate and run pre-existing lines of code! Watch out for bugs eating away your program!

100% of 41 Steam reviews are positive$4.39
Rezist: Tower Defense

Rezist: Tower Defense

Protect your server from the malicious software intrusion. Improve your utility programs in time, rollout patches — and you will stand fearless even…

100% of 7 Steam reviews are positive$0.99
Data Defense

Data Defense

Defend your data servers from viral corruption in Data Defense - a minimalist tower defense set in cyberspace.

91% of 33 Steam reviews are positive$9.99
FORK BOMB: A Programming Game

FORK BOMB: A Programming Game

Write real code in a Python-like language to control one machine that copies itself. Then watch a thousand copies of your program eat a world.

100% of 10 Steam reviews are positive$9.99
Screeps: World

Screeps: World

Write JavaScript that mines, builds and fights for your colony in a shared world, even while you sleep.

86% of 1,946 Steam reviews are positivePlayers online now: 59$6.79
Move Code Lines

Move Code Lines

Move Code Lines is a game where you fix programs and make them print needed output.

82% of 92 Steam reviews are positive$7.99