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 ...

Get Game Development with Swift 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.