As said on my last post here, I’ve started working on my first iPhone game and after looking around a bit decided to use cocos2d. I also decide to remake a multiplayer flash game I’ve already donne on cocos2d for Iphone.
It’s a soccer football game, a turn based one, and you have 3 coin-style players each side, for each turn both players set it’s next movement by selecting the coin and moving an arrow to the direction you want your next move to be.
So I want the player to have the arrow last selected to be on top of other so you can see better where you might be moving to on next turn.
Here is the code for Cocos2D z ordering.
[parentNode reorderChild:spriteName z:(theZOrder)];
in my case I will do it on my ccTouchesBegan:
[self reorderChild:p1Sprite z:zOrderTop];
where zOrderTop is my last Sprite.
Hope it helps.