5 minutes
Win and Lose
Everything in the scene announces things. Ships die and say so; waves clear and say so; the freighter that doesn't exist would announce its own destruction. Nobody is listening. You can kill every enemy in the field and the game will not react, because no component in the scene holds an opinion about how a run ends.
One line fixes it:
Six kills wins. And because the component name matches its System's name, the loader wires it for you. No cabinet edit this lesson.
What a run is made of
Three numbers, a flag and a string: five fields, all serializable, all meaningful after a reload. lives defaults to 3. kills and objectiveComplete are progress. status is 'active' | 'won' | 'lost'.
killQuota: 0 is the interesting default: it disables the kill-count win. A mission with no quota can't be won by shooting, and has to be won some other way, which is the door the next section walks through.
A quota wins the run here because "clear every wave" cannot. Last lesson's director has an ALL_CLEARED event that sounds exactly right, and it can never fire in this scene: four ships are bucketed behind a waypoint gate that doesn't exist, so a wave stays pending forever. A quota needs nothing from the schedule.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.