Search code examples
iosdictionarycocos2d-iphonetile

Dynamic Tile Map possible with Cocos2D?


I want to be able to load a list or an array of tiles and displayed them on a map.

Cocos2D offers a possibility to load tiles on a map. But for my case, I have to load just a specific part/range of tiles (which I define) and this changes dynamically during the run time. I never want to load the whole map at once. Is this possibile? Maybe an alternative to Cocos2D on iOS? The map details come from a server. It should be done in a quite large multiplayer environment, that's why each player/client should only load his relevant parts of the map.


Solution

  • You can definitely do this, and there are many different ways. For example, swapping scenes or layers during run time, with different tile maps on them, or by creating tile maps your own way with a custom set of methods using CCSprite (for example, it is common to create your own parallax scene instead of using the built-in Parallax scene methods in Cocos2d, and you could do the same with tile maps, if desired). The options are really limited only by creativity.