Summary
We have made great strides in this chapter. Our new class organization will serve us well over the course of this book. We learned how to use protocols to enforce commonality across classes, encapsulated our game objects into distinct classes, and explored tiling textures over the width of the ground node. Finally, we cleaned out some of our previous learning code from GameScene
and used the new class system to spawn all of our game objects.
We also applied the physics simulation to our game. We have only scratched the surface of the powerful physics system in SpriteKit—we will dive deeper into custom collision events in Chapter 7, Implementing Collision Events—but we have already gained quite a bit of functionality. We explored the three types of physics bodies and studied the various physics properties you can use to fine-tune the physical behavior of your game objects. Then, we put all of our hard work into practice by bumping our bees together and watching the results...