Lately I’ve been building a lot of tilemap based games in Cocos2D and I’ve got to say, it’s pretty freaking sweet. There’s a lot of great tutorials on how to get started, plenty of help in the Cocos2D forums, and even a few videos people have put together. I did run into an issue today that I felt others may run into, so I wanted to post the solution.
I have a few levels in my game which require more than one TileMap. I ended up using two tile maps in 1 layer and I got the following compiler error:
*** Assertion failure in -[CCTMXLayer setupTiles]
This error is actually masking an error, and it took about 10 minutes for me to track down the actual problem. You can not use more than 1 TileMap per Layer. If you’re using TileD you just need to create a new layer and use your 2nd TileMap on it. All will be well. If you’re not using TileD then you are missing out because it’s a seriously awesome tool.