how to create a game tilemap to use in SpriteKit games

When I started to get into games development with SpriteKit, the hardest thing to do was making levels or game maps. The SpriteKit Scene Editor appeared to suck and to have too many issues.

So I made my own map editor which was a lot of work and wasn’t great and it was too specific to a single game. I tried to find out if other people perhaps made map editors for games.

I quickly stumbled upon the Tiled map editor which isn’t that bad, used by many, and stores game maps in the open TMX tile map format. On macOS Tiled looks totally un-macOS-sy and it has some strange bugs and weird ways to handle things. For instance, you cannot select a tile on the map and view or change its properties. You can only delete it or place another tile on top of it.

Anyway, it has tons of features and the TMX map format is nice and compact. Even when using compression, the TMX files are still human readable which is a plus.

After creating your map with Tiled, you can use the PEMTileMap framework to add the map to your SpriteKit  Swift game.

use the Tiled map editor with PEMTileMap

  • use the Tiled map editor to create tilesets and maps
  • add the map files, sprites and tilesets to your Xcode project
  • use the PEMTileMap framework to render the map in any SpriteKit / Swift app

Get the Tiled map editor for free here.

Get the PEMTileMap framework for free here.

Yay! An ad!