Hi,
I am able to rotate and move the body of my tank (have not created the turret yet) using SneakyInput Joystick. The problem that I am having is that I want the front of the tank to face in the direction (degrees) of the joystick. Looking for ideas...
I think I need to rotate first, so that the sprite is facing the correct position ANd then actually move the sprite.
Right now it doesn't look very realistic - there is no way that a real tank could drive the way that it currently does in my game :-)
I have tried manipulating the anchor point but I'm still learning how to control sprite movement. Right now I am simply rotating the sprite like this:
if (leftJoystick.isActive) {
tank.rotation = leftJoystick.degrees-90.0;
}
The reason for the -90.0 is just to have the front of the tank pointing to 90 degrees when the joystick is pushed in that direction. I have looked for posts on the forum and was able to learn from this one: http://www.cocos2d-iphone.org/forum/topic/8156#post-47468
Any suggestions are appreciated.