Hi,
Im porting my game from andengine to cocos2dx. And i have some problems.
1 - Position x = 0 and y = 0
When i set sprite position to “0, 0”, instead of it be on TOP and LEFT of screen, it goes to BOTTOM and LEFT. Look the image:
http://www.prsolucoes.com/downloads/error-cocos-1.png
I think that i any reference position to configure. Any idea?
2 - Cant change position or move a sprite
When try change sprite position after add as child of scene, the same problem i get when use an action to move player, get some errors, look the image:
http://www.prsolucoes.com/downloads/error-cocos-2.png
My code to do it:
layerPlayers~~>addChild);
GameObjects::player~~>getSprite()>setPosition);>getSprite()->runAction(moveAction);
>
cocos2d::CCMoveTo *moveAction = cocos2d::CCMoveTo::actionWithDuration);
GameObjects::player
The strange problem is that i dont get this error always that i execute. Have some times that it start and other times it doesnt happen. But on most time i got the error. I think that can be a concurrency problem or something like this, or something that is updating the sprite, i dont know. Any idea?
Thanks