Hey Eveyone,
I am trying to get my sprite to jump to a tile that was touched. The sprite does not go directly onto the tile. It seems to always land somewhere around where I touched, but not directly. How do I get the sprite to only land on the middle of each tile?
Here is my action:
float touchTilex = floor(touchLocation.x / _tileMap.tileSize.width);
float touchTiley = floor(touchLocation.y / _tileMap.tileSize.height);
if(touch.tapCount ==1)
{
[_player runAction:[CCJumpTo actionWithDuration:1 position:ccp(touchTilex*_tileMap.tileSize.width, touchTiley*_tileMap.tileSize.height) height:10 jumps:4]];
}