April 2021
Beginner to intermediate
506 pages
11h 57m
English
To keep the player from leaving the dungeon, you’ll set up physics bodies around the dungeon walls. However, there’s a small problem: tile map nodes do not expose their tiles as nodes, which means you can’t assign physics bodies to the individual tiles. Instead, you’ll use custom user data, more specifically, the userData property of the SKNode class.
The userData property of the SKNode class is an NSMutableDictionary that you can use to store custom values known as “user data.” These custom values can include integers, floats, booleans, and strings. You can either set these up in code or, more conveniently, using the Scene Editor and the Attributes Inspector (there’s a User Data section near the bottom). ...
Read now
Unlock full access