Hi, I'm trying to load sprites from a .tmx map file. I saw the Pusher game example, which could do it from a .tga file using the tilemapatlas. Unfortunately in cocos2d 8.1 that feature isn't the same anymore. Basically how it worked was a loop would run through every tile on the map and figure out what kind of tile it was. Then it would return a number based on the type of tile. Here is an example of the code:
for(x = 0; x < cols; x++)
{
for(y = 0; y < rows; y++)
{
ccGridSize cell = ccg(x, y);
ccRGBB tile = [tilemap tileAt:cell];
if(tile.b == 1)
{
NpcSprite *mySprite = [[NpcSprite alloc] init];
[tilemap add:mySprite z:7 tag: i];
mySprite.position = ccp(x*tilesize,y*tilesize);
i++;
}
}
How would I find out what type of tile is at each cell and draw a sprite whenever that tile comes up in the loop using cocos2d 8.1 .tmx map files?