5 minutes
The Oil Blob
Rock is a passive hazard. It punishes you for flying badly, and that's all it does. A boulder never made a decision. This lesson adds the other kind: a hazard that answers. Shoot an oil blob and it spits a lethal drop back along the line your round came in on.
You need no new field component to do it. The one on World already has the switch.
Add the blobs and the drop pool
Two new entities. The first is a field of blobs:
Same component as World's, different dials: ten blobs instead of 110 rocks, all of them between 35 and 60 units across, on a shell starting further out. Ten blobs, and all ten find a home. Small hazards on a wide shell rarely fail to place. They end up 394 to 719 units from the origin, scattered through the rock you already have.
Two AsteroidField components in one scene, on two entities, is not a special case. The System's query is required: [AsteroidFieldComponent], and it builds every field it finds, once each.
The second entity is a pool for what the blobs shoot back:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.