Escort Run
Loading…
Defender (teal): W A S D to move, F to fire Attacker (red): arrow keys to move, Enter to fire
On a tablet: left half of the screen is the defender, right half the attacker. Drag to steer; while your finger is down you fire.
How to play
Two players share one keyboard. The cargo plane (gray) flies a weaving path on its own. The defender must keep it alive until the countdown ends. The attacker must shoot it down first. Click the game once before using the keys. You fire in the direction you last moved.
Rules at a glance
| Item | Value |
|---|---|
| Defender wins | Cargo survives 60 seconds |
| Attacker wins | Cargo health reaches 0 (25 hits, 4 damage each) |
| Fighter health | 5 hits, then respawn after 2 seconds with 1.5 seconds of invulnerability |
| Fire rate | Defender 0.22 s between shots, attacker 0.28 s |
| Blocking | Attacker bullets hit the defender if they reach it before the cargo |
| Defender bullets | Only hurt the attacker, never the cargo |
Easy things to tweak
| What to change | In the code |
|---|---|
| Round length | GOAL (seconds) |
| Player speed | const sp = 260 in move() |
| Cargo damage per hit | cargo.hp -= 4 in update() |
| Cargo weave height and speed | 130 and 0.7 in the cargo.y line |
| Fire rate | 0.22 and 0.28 in move() |
| Fighter health | hp: 5 in mk() |
Source code (game.js, fully commented)
This is the exact code running the game above, split into nine numbered sections: setup, keyboard input, game state, effects, player logic, update, drawing helpers, draw, and the game loop. To use it in your own project, copy it into a game.js file next to an HTML page that has the same element ids and a stylesheet. Download game.js
Loading…
Game idea by Ryan.