Hello.
straight to the point,
I made a side scrolling game in tile-map format.
I tried the getTileGIDAt function because I wanted to build a hill.
At first, I succeeded in making a wall because my character movement was in touch format.
Currently, it is a way for characters to move to joystick and use box2d. The result is that the character passes through the wall.
How do I make a wall or hill in this situation?
I thought about one thing,
First, this function is used to locate each tile.
cocos2d::Vec2 Game::tileCoordForPosition(cocos2d::Vec2 position)
{
int x = position.x / tMap->getTileSize().width;
int y = ((tMap->getMapSize().height * tMap->getTileSize().height) - position.y) / tMap->getTileSize().height;
return Vec2(x, y);
}
Second, make a b2EdgeShape using the tile value I have got
=======
Is this the only way?
Iām having a hard time with this problem. Help me.