Animating Tiles

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Add a Dungeon Tile Map | TOC | Configure Physics Bodies Using User Data 👉

In the Project Navigator, select the Assets.xcassets asset catalog and create another new sprite atlas. Name this one tiles_animated and remove the empty Sprite image set.

Open Finder and drag all of the image assets from the resources/tiles_animated folder into the tiles_animated atlas. When you’re done, you’ll end up with something like this:

images/ExtendingYourGameWorldWithTileMaps/scene-editor-dungeon-animated-tiles-atlas.png

Switch to the MainTileSet.sks file — you’re about to add another Center variant.

Expand the Dungeon Tile Set and then the Dungeon Floor. Select the Center tile (it may already be selected from when you added the center_alt variant).

Open the Media Library and drag the fire_0 image asset into the Add New Variant empty space. Select the fire_ tile variant and open the Attributes Inspector.

Using the Media Library, drag the other fire assets (fire_1, fire_2, and fire_3) into the Textures area, like so:

images/ExtendingYourGameWorldWithTileMaps/scene-editor-dungeon-animated-tiles.png

--

--

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.