$9.00
Space Combat with Arcade ECS
Course 2 of the three-part Wingman build-along. Starting from the finished Course-1 flight scene, you add space combat to the ship using the real BabylonJS Market combat components — guns, per-part damage, lock-on homing missiles, and enemy AI — until two enemy fighters are chasing and shooting at you.
What We Will Cover
- Starts from the finished Course-1 flight scene and adds the combat layer
- Every code block is the actual published component source
- Pooled tracer guns, a swept-AABB per-part damage model, and lock-on missiles
- Enemy dogfight AI that orbits, banks into the turn, and shoots back
- Ends in a working browser dogfight identical to the combat checkpoint scene
This is Course 2 of the three-part Wingman build-along. You begin from the exact scene you finished in Course 1 — a GLB fighter you fly gimbal-lock-free through deep space, trailed by a smoothed chase camera — and, lesson by lesson, compose the shipped Wingman combat components into a live dogfight. You add a nose-mounted machine gun that fires pooled tracer bullets; a swept-AABB collision system that reads a ship as a list of per-part hitboxes instead of one HP bar; a named-loadout indirection that kits a ship with its parts and aggregate health from JSON; the shared kill path that blows a ship apart into shootable debris on a critical hit; enemy pilots that orbit, bank into the turn, and open fire; a sticky forward-cone missile lock; homing lock-on missiles with a capped turn rate; and the pooled-recycle and death-pause countdowns. Every runnable code block is a verbatim slice of the live component source — nothing is invented. The finished scene equals the combat subset of the real WingmanFlight scene, entity for entity: your Course-1 ship fitted with the combat components, plus two enemy fighters orbiting and shooting back. Course 3 (Hazards and Mission) adds the asteroids, the return-fire hazards, the escort convoy, and the mission director on top of the game you finish here.