Looping encounters for a never-ending world
We need at least three encounters to endlessly cycle and create a never-ending world; two can be on the screen at any one time, with a third positioned ahead of the player. We can track Pierre's progress and reposition the encounter nodes ahead of him.
Building more encounters
We need to build at least two more encounters before we can implement the repositioning system. You can create more if you like; the system will support any number of encounters. For now, add two more SpriteKit scene files to your game: EncounterB.sks
and EncounterC.sks
. Resize these scenes to 900
wide by 600
tall, the same as EncounterA
. You can fill these encounters with Bees, Blades, Coins, and Bats—have fun! Make sure to assign ...
Get Swift Game Development - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.