Chapter 24
Platform Game Physics
In the previous chapter, you learned how to create an animated character. You also learned how to build a tile-based game world by reading level data from a text file. One of the most important aspects is still missing: defining how the character interacts with the game world. You can make a character move from left to right, but if you simply place the character in the level, it can only walk on the bottom of the screen. This isn’t enough. You want the character to be able to jump on top of tiles and fall down if it moves off a tile, and you don’t want the character to fall off the edge of the screen. For these things, you need a physics system.
You could use the existing physics engine provided with the SpriteKit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access