Create a Tile Map Node

Apple Game Frameworks and Technologies — by Tammy Coron (97 / 193)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Create a Bigger World with Tile Map Nodes | TOC | Use the Tile Map Editor 👉

In the Project Navigator, select the GameScene.sks file. (You may want to zoom out so that you can see the entire scene in the Scene Editor.)

Open the Object Library (⇧⌘L) and drag a new Tile Map Node into the Scene Graph View, as shown in the image.

images/ExtendingYourGameWorldWithTileMaps/scene-editor-add-tile-map-node.png

Select the Tile Map Node in the Scene Graph View and look at the Attributes Inspector. Set the tile map node’s Name to Grass Tile Map and its Position to (x: 0, y: 0).

You’ll see some other familiar settings like the Anchor Point and Scale, which you won’t need to change, but just below those settings you’ll see some new options:

images/ExtendingYourGameWorldWithTileMaps/scene-editor-tile-map-node-attributes.png

The Tile Sets drop-down list is where you select the tile set this map node will use. A tile map node can only pull tiles from a single tile set. In this case, you only created one tile set, Grass Tile Set, so select that one from the drop-down list if it’s not already selected.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.