5 minutes
Make a Kill Visible
Every rule of this game now works. A kill still looks like a bug. The fighter you have been chasing for twenty seconds stops existing between one frame and the next, and the only way to be sure you got it is to check a number.
The details were never missing. destroyShip has been emitting spaceshooter.explosion since Course 2, the launcher spaceshooter.missile.fired, the missile spaceshooter.missile.exploded: three events, carrying exact world positions, into a bus with nobody on the other end. This lesson adds the other end.
An explosion is two layers
Three thousand particles, thrown hard (maxEmitPower 130) from an almost-zero radius, alive for at most 1.6 seconds. That is the flash. It arrives at once, spreads fast, and is gone before you are done reacting to it.
Put the two specs side by side and every number moves together. Fewer particles (700 against 3000), smaller (0.95 max against 2.6), thrown gently (55 against 130), and living twice as long (3.4 seconds against 1.6). Both fire at the same instant from the same point.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.