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

ItemValue
Defender winsCargo survives 60 seconds
Attacker winsCargo health reaches 0 (25 hits, 4 damage each)
Fighter health5 hits, then respawn after 2 seconds with 1.5 seconds of invulnerability
Fire rateDefender 0.22 s between shots, attacker 0.28 s
BlockingAttacker bullets hit the defender if they reach it before the cargo
Defender bulletsOnly hurt the attacker, never the cargo

Easy things to tweak

What to changeIn the code
Round lengthGOAL (seconds)
Player speedconst sp = 260 in move()
Cargo damage per hitcargo.hp -= 4 in update()
Cargo weave height and speed130 and 0.7 in the cargo.y line
Fire rate0.22 and 0.28 in move()
Fighter healthhp: 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.