Search code examples
cocos2d-iphonecocos2d-x

Using tiled maps for a soccer field in cocos2dx


I am writing a simple soccer game in cocos2d-x and recently found out that older iOS versions do not support cocos2d sprites larger than 1024x1024px.

I was thinking about using isometric tilemaps to create a larger football field.

Is this the way to go ? If so, how can i convert a convert my 2048x2048px football field image into several isometric tiles ?


Solution

  • Yes use a TMX tile map, it is far more efficient and smoother than using a huge sprite anyway and consumes far less memory. Have a look for a tilemap program such as 'Tiled'.

    For the football pitch just draw a few grass tiles and some with line markings on them, then you 'paint' these tiles onto your tilemap. It depends on how you want it to look, but you should only need to draw just a few tiles (the performance advantage comes from using the same tiles many times).