I'm having some trouble trying to make a sprite appear to be standing on a layer of a TMX map.
Once the z order I give the sprite is higher then the bottom layer of my .tmx map, it always appears on top of my all my layers.
I want it to appear to be standing on layer 1 but under the higher layers.
Here is my code:
CCTMXTiledMap *map = [CCTMXTiledMap tiledMapWithTMXFile:@"testmap4.tmx"];
[self addChild:map];
//
[map reorderChild:[map layerNamed:@"Layer 0"] z:1];
[map reorderChild:[map layerNamed:@"Layer 1"] z:2];
//Adding a player sprite
CCSprite *player = [CCSprite spriteWithFile:@"h1.png" rect:CGRectMake(0, 0, 24, 48)];
player.position = ccp(240, 160);
[self addChild:player z:3];
[map reorderChild:[map layerNamed:@"Layer 2"] z:4];
[map reorderChild:[map layerNamed:@"Layer 3"] z:5];
[map reorderChild:[map layerNamed:@"Layer 4"] z:6];
The sprite looks like it's on z:7 or higher all the time.