← DEVLOG
Arcade2025.12.309 min read

Orbital Defense — Protect Earth, Strategy in Orbit

An orbital tower defense where you deploy 5 types of defense satellites to stop enemies spiraling toward Earth. A look into the balance and strategy design process.

tower-defensestrategyorbitcanvasspacegravity

The Spark — Tower Defense in Space

Tower defense is a well-worn genre. Enemies march along a fixed path; you build towers to stop them. Simple, but strategically deep.

What if we moved this concept into space? Instead of straight paths, curved orbital trajectories. Instead of stationary turrets, satellites that orbit alongside the action. And gravity as a wild card. Orbital Defense started from these three twists.


The Orbital System — A Battlefield by Kepler

The game's defining feature is five concentric orbits forming the battlefield. Inner orbits rotate faster than outer ones — following Kepler's actual laws of planetary motion.

const angularSpeed = BASE_SPEED / Math.sqrt(radius / innerRadius);

Inner-orbit towers sweep a wide area quickly but can't focus fire on a single target for long. Outer-orbit towers move slowly but keep enemies in range longer. Where you place what becomes the foundation of every strategy.

Enemies spawn at the outermost orbit and spiral inward, getting one ring closer with each revolution. When they reach the central Earth, they deal HP damage. HP hits zero — game over.


The Balancing Act — Combinatorial Complexity

Balance is the hardest part of any tower defense. Five tower types, five enemy types, five orbits, three upgrade levels — the combination space explodes exponentially.

Per-Orbit Energy Budgets

Initially I limited towers by count per orbit. But one expensive tower and three cheap ones sharing the same cap felt unfair. So I introduced per-orbit energy budgets.

OrbitBudgetCharacter
1 (innermost)60Tight space, fast rotation
280
3100Balanced middle ground
4120
5 (outermost)140Wide space, slow rotation

A Laser satellite (cost 20) fits three times on orbit 1, but a Gravity Anchor (cost 45) fits only once. This constraint creates meaningful placement decisions.

Enemy Diversity

Each of the five enemy types demands a different counter-strategy.

Drones are the bread and butter — numerous but fragile. Laser satellites handle them efficiently.

Comets ignore orbits entirely and charge straight at Earth. They punch through spiral defense lines, demanding interceptors on inner orbits.

Carriers are slow but heavily armored, spawning mini drones every time they cross an orbit boundary. Ignore them early and the field floods.

Stealth ships are invisible until an EMP satellite reveals them. Before detection, they sneak up to your towers and sabotage them directly. This makes EMP placement essential.

Bosses orbit in the opposite direction from everything else, creating blind spots in your defense line. They also hit multiple towers at once with area attacks.


Strategic Depth — Making Choices Matter

Gravity Anchors

This was the tower I agonized over most. Would players spend resources on something that deals zero damage? The answer was to give it a unique value: path manipulation.

Gravity anchors bend nearby enemy trajectories in real-time. You can force enemies through a kill zone longer, or deflect a comet's straight charge into a longer path. Well-placed, they more than double the efficiency of your other towers.

Under the hood, it uses real gravitational acceleration:

const g = gravityAccel(G, mass, dx, dy, softening);
enemy.x = orbitPos.x + gx;
enemy.y = orbitPos.y + gy;

Rush Mode

Every wave has a time limit. When it expires, Rush Mode kicks in — all enemies triple their speed and become immune to EMP stuns. The message: "you can't just turtle." You have to engage aggressively and clear within the window.

Clearing before time runs out earns bonus energy proportional to remaining seconds. Faster clear → more resources → stronger setup. A virtuous cycle.

Upgrade vs. Quantity

Towers upgrade to level 3, gaining range, damage, and fire rate. But upgrade costs could buy new towers instead. One Lv3 Laser or three Lv1 Lasers? The right answer depends on context, and that judgment call is where the fun lives.


20-Wave Campaign Design

The wave composition follows a deliberate learning curve.

PhaseContentIntent
1–3Drones onlyLearn basic controls
4–6Comets appearLearn to counter straight charges
7–9Carriers arriveDeal with high HP + drone swarms
10Mini-bossMidpoint checkpoint
11–14Stealth joins, all types mixedEMP becomes essential
15–19Multi-direction spawns, large wavesFull strategic test
20Final bossVictory!

After clearing the campaign, Infinite Mode unlocks. Enemy HP, speed, and count scale up 10% per wave — how long can you survive?


Rendering — Canvas + HTML Hybrid

The game scene (orbits, enemies, towers, projectiles, particles) renders on Canvas 2D, while UI (HUD, tower bar, upgrade panel) uses HTML+CSS. The benefits are clear:

  • Canvas: 60fps animation, math-driven rendering (orbits, gravity field contours)
  • HTML: accessibility, responsive layout, i18n support

Earth isn't just a circle — it has four continent patches, cloud wisps, and atmospheric rim lighting. A small touch to make the thing you're protecting feel worth saving.


Sound Design

Every sound effect is synthesized purely with Web Audio API. No external audio files at all.

Lasers use sine wave sweeps (1000→2000Hz), missiles get noise bursts with a low drone, EMPs use wide-band noise with a high-pass sweep. Each tower has a distinct attack sound, so you can read the battlefield by ear alone.

The BGM is tense ambient — low drones with pulse rhythm underneath. Tension builds naturally as waves progress.


Closing Thoughts

The question I kept coming back to while building Orbital Defense was: "Is this fair?" When a player loses, they should think "my strategy fell short," not "that was random." When they win, they should feel "that was a good call." A game decided by judgment, not luck.

Five tower types, five enemy types, five orbits, gravity as a variable — the combination space is vast, but navigating it to find optimal solutions is the essential joy of tower defense. I look forward to seeing your orbital strategies.

Content related to this post

Try it yourself