What it does
You aim a crosshair, with a pointer or by moving it, and fire from a chosen battery or let the game pick one: the nearest with ammunition, as the arcade did, or the one whose counter-missile would arrive soonest. A counter-missile flies straight from its battery at that battery's speed and bursts exactly on the aim point. Each explosion steps through an authored table of radii, growing, holding and shrinking, and destroys any attack that enters it, by an octagonal distance test as in the original or a circle. With chaining on, whatever it destroys explodes in turn, so a well-placed shot clears a cluster.
Incoming waves launch in batches, gated by the height of the attacks already falling and a number of attack slots. Each missile aims at a city or battery that no other attack is already aimed at, and an optional cap limits how many cities a wave can take. Missiles split into more warheads by the original's rule or a simpler one; smart bombs probe around them for explosions and step aside; fliers cross the sky and drop volleys.
When a wave ends, the tally pays for every counter-missile left and every city standing, times the wave's multiplier.
Bonus cities are banked at score thresholds and rebuild ruins at random, batteries are restored and refilled or carry
their ammunition over, and the game ends when no city is left. You tick it with aim and fire orders, read state, and
present the events it drains, from abm-launch and explosion to mirv, impact and tally-abm.
Features
- Batteries and launch policies — positions, ammunition, counter-missile speed and blast per battery, fired by choice, by nearest or by fastest arrival, with low-ammo and empty warnings.
- Timed, chaining explosions — authored radius tables, octagonal or circular kill tests, a safe ground band and a cap on live explosions.
- Waves by table — missile budgets, speeds, launch heights, smart bombs and fliers per wave, or a table built from simple ramps.
- Splitting warheads — the original's candidate rule or an in-band rule, with split counts, chance and a limit while the sky is busy.
- Smart bombs — no trail, probing eight points around them and taking the safest heading toward their target.
- Fliers — bombers and satellites crossing at a height band and firing volleys.
- Fair targeting — each attack picks an untargeted city or battery, under an optional per-wave loss cap.
- Scoring and bonuses — wave multipliers, counter-missile and survivor bonuses, bonus cities and a tally.
- A defence bot — picks the lowest uncovered attack and the battery that meets it soonest, leading the shot.
- Deterministic — fixed 60 Hz steps, a seed and snapshots.
Good for
- City-defence interception games in the style of the 1980 arcade Missile Command.
- Planetary shield games, where you place area blasts against falling threats.
- Tower defence where you aim the blasts rather than placing towers.
- Touch and mouse arcade games, since a tap or click is both the aim and the shot.
- Attract modes and assists, with the defence bot choosing and leading shots.
Make it yours
missileCommandPreset takes the number of cities, the ammunition, the bonus-city threshold, the split chance, the
per-wave city loss cap and a seed, and any field of the definition it returns can then be replaced: the field size,
the crosshair, the batteries and targets, the launch policy and limits, attack slots and batch sizes, every attack's
score, size and behaviour, the explosion tables and kill shape, the wave and multiplier tables, the bonuses, the early
end rules, replenishment and battery restoration.
Two very different games are tested and playable. The arcade preset has three bases of ten counter-missiles each, six cities, a three-city loss cap per wave and a bonus city every 10,000 points. The twin-battery variant is a 320 by 240 field with two batteries on cliffs at different speeds, five to seven targets including a reactor worth 300, the fastest-arrival launch policy, ammunition carried between waves, no loss cap, warheads that split once into pairs, bombers only, one smart bomb at a time from the fourth wave, and a multiplier that climbs every wave.
A quick look
The arcade game, fired by pointer or by keys, with its events and state:
const md = game.missileDefence;
const g = md.createMissileDefence(md.missileCommandPreset());
g.tick(dt, { aim: pointerInModelUnits, fire: clicked ? ['auto'] : [] }); // fixed 60 Hz frames inside
g.tick(dt, { move: { x: right - left, y: down - up }, fire: keyA ? [0] : [] });
for (const e of g.drain()) { /* abm-launch, explosion, mirv, impact, target-destroyed, game-over… */ }
const s = g.state; // batteries, targets, abms, attacks, explosions, cursor, score, wave
Works with
vector-2d— for the trails, explosions and crosshair as glowing line art.post-bloom— for the glow of explosions.projectile-patternsandencounter-director— for free-flying shooters, which this pack does not handle.
Good to know
- One player: two-player alternation, cocktail flipping, trackball acceleration and sound are left to your game.
- Every attack moves exactly its speed along its line, and smart bombs dodge by explosion geometry rather than screen pixels, small departures from the original.
- It does not cover ballistic artillery duels.
- Bounds: up to 64 batteries, 1,000 targets and explosion tables of 10,000 steps, and a snapshot restores into a game built from the same definition.






