public void reorderSprites(float dt) { CCSpriteBatchNode spritebatch = (CCSpriteBatchNode)getChildByTag((int)kTagSprite.kTagSprite1); CCSprite father = (CCSprite)spritebatch.getChildByTag((int)kTagSprite.kTagSprite2); CCSprite left = (CCSprite)father.getChildByTag((int)kTags.kTagSpriteLeft); CCSprite right = (CCSprite)father.getChildByTag((int)kTags.kTagSpriteRight); int newZLeft = 1; if (left.zOrder == 1) { newZLeft = -1; } father.reorderChild(left, newZLeft); father.reorderChild(right, -newZLeft); }