AutoRunnerBomber
The bomber: a helicopter that sits ahead of you and drops bombs where you are about to be.
What it does
autoRunnerBomber.dispatch takes the bomber from its pool and brings it in 70 m behind the player, a little above its flying height. It settles onto a station ahead metres in front of the car, weaves across the road, and drops a bomb every bombEvery seconds or so. Each bomb is aimed at where the car will be when it lands. Brake or swerve and it misses.
When its stay time is up or its bombs run out, the bomber climbs, pulls away up the road and goes back to its pool. With the defaults it usually runs out of bombs first: a full load lasts about 18 seconds.
Give its blueprint the air tag and a Health. Only rounds that reach the air, which means missiles, can hurt it. When health.died arrives for it, the bomber is removed on the next frame.
Use it in a scene
A scene is just data — a list of entities, each with its components. At startup the SceneLoader turns this JSON into a live world; edit the file and reload to rebuild it.
Build it from scratch with the bjs CLI:
- 1Scaffold a project
World, renderer, and dev server — ready to run.
- 2Install dependencies
- 3Add AutoRunnerBomber
Copies its source into src/ so the scene resolves.
First time? Run bjs login once.
- 4Paste the scene into src/scenes/arcade-room.ts and run
SceneLoader builds the world from the JSON; reload to rebuild.
The bomber works out its aim with a gravity of 16 and sends that gravity with every bomb it drops, so the bomb blueprint's own gravity never throws the aim off.
Leading the target
Two numbers decide where a bomb lands: how long it falls, and how far the car goes in that time.
(ax, az) is where the car will be after t seconds at its current speed. The bomb is thrown at whatever speed carries it there in the same t, capped at 70 m/s. A worked drop with the defaults and a car doing 40 m/s:
The bomb comes down where the car would have been. A player who brakes is short of it; one who changes lanes is beside it.
The station
ds is distance up the road from the car and u is distance across it. Both are measured along the road, so the station follows the bends. Around ahead, the bomber drifts 6 m forward and back, and it weaves sway metres either side, but never more than 2 m past the road's edge. A random seed per flight keeps two bombers from flying in step.
Model and shadow
The body is the entity's own MeshPrimitive, reshaped once into a helicopter about 8 m nose to tail and painted bodyColor. Its Shadow then throws a helicopter-shaped shadow on the road. The rotor and a blinking red beacon are separate meshes the System owns. The rotor spins at rotorSpeed and casts a flickering shadow from the first sun announced on directionallight.created.
Settings
| Field | Default | What it does |
|---|---|---|
pool | "helicopter" | Pool that autoRunnerBomber.dispatch draws from. Every bomber blueprint should name the same one. |
target | "Player" | The car it hunts |
altitude | 15 | Flying height, metres |
ahead | 34 | How far ahead of the target it holds station, metres |
sway | 8 | How far it weaves across the road, metres |
bombEvery | 1.5 | Seconds between bombs, give or take 25% |
bombs | 12 | Bombs it carries |
bombPool | "bomb" | Pool the bombs come from |
stay | 26 | Seconds it stays before leaving |
rotorSpeed | 24 | Rotor spin, rad/s |
agility | 1.6 | How quickly it closes on its station, per second. It uses 1.8 times this while it flies in. |
bodyColor | [0.16, 0.17, 0.18] | Body colour, RGB from 0 to 1 |
Events
| Event | Payload | Direction |
|---|---|---|
autoRunnerBomber.arrived | { entityId } | emits |
autoRunnerBomber.bomb.dropped | { entityId, x, z } | emits |
autoRunnerBomber.left | { entityId } | emits, when it turns to leave |
autoRunnerBomber.dispatch | {} | listens |
health.died | { entityId } | listens: a shot-down bomber is removed |
directionallight.created | { entityId, handle, direction, position, intensity } | listens: the rotor's shadow comes from this light |
Needs
- MeshPrimitive is the body.
- CarDrive gives the target's heading and speed, for the lead.
- HighwayRoad gives road distance and width, so the station follows the road.
- AutoRunnerProjectile supplies the bombs through
launchProjectile. - Shadow casts the body's shadow.
- Health lets missiles shoot it down.




























































