New answers tagged cocos2d
Te problem here was that the cocos method to rotate an sprite uses degrees, but the sin() and cos() methods are from the math library of c++, so they work with radians. In the end I've made a function to change from degrees to radians and use it to transform the _dragonSprite->getRotation() to rads.
One approach is to take the coordinates of the users click in game world and interpolate the points on either side to alter the terrain. The result are going to be determined by your method of interpolation. For instance a linear interpolation will result in triangle forming. https://en.wikipedia.org/wiki/Interpolation
I used an A* search algorithm. If your game is rendering tiles, then use this to determine if the tiles are solid or not. It creates a path of "passable" tiles for the enemy to follow the player around walls, in the shortest distance. It could easily be adapted for detecting if the surrounding tiles are solid or not (see through or not). Basically, you need ...
Top 50 recent answers are included