Hey I am new to cocos2d-x and please help me to find out the solution of my problem, basically i want to set vertexZ in an Isometric Map so that the my playerSprite hides behind any object like trees or wall or houses etc to give a 3D impression.
To achieve this i tried to implement the code and my playerSprite starts hiding behind an object But i am stuck with one problem like when player come closer or in front of the object then player looks that its standing at very low layer.
I think may be this is the problem with layer… i paste my code so please check it out and give me suggestion.
void gameScene::repositionSprite(float dt)
CCPoint p = player->getPosition();
p = CC_POINT_POINTS_TO_PIXELS§;
CCNode **tileMap = getChildByTag;
int newZ = 4 - ;
newZ = max;
here, int newZ* always give me MAX value 0 and when *reorderChild()* set the player it will always set my player at 0th layer and if manually i update the layer from 0 to 1 then i failed to achieve the output and player don’t hide and move over the object.
i call this above method from the scheduler in the init() method and also set 2Dprojection like this :
if this can’t be implemented then please help me implementing vertexZ