Errors when creating Large TileMaps with Cocos2D


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.



2 Responses to “Errors when creating Large TileMaps with Cocos2D”

  1. 1 Marty B April 8, 2013 at 3:23 am

    Thank you so much!!! only answer that actually solves this on the internet!!!!!!!!!!

  2. 2 tom May 30, 2013 at 9:14 am

    Thank you, I was searching for three hours…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: