This is not really related to Box2D but here goes..
Im making a cannon game, and im trying to figure out how i can make the enemy fire at the position of the body of the player.
So i have the coordinates but i need to figure out the angle and maybe velocity so the enemy can fire the projectile correctly at the player.
I found this formula: http://en.wikipedia.org/wiki/Trajectory_of_a_projectile but i have no idea how to implement it!
Any ideas?
Thanks
Im making a cannon game, and im trying to figure out how i can make the enemy fire at the position of the body of the player.
So i have the coordinates but i need to figure out the angle and maybe velocity so the enemy can fire the projectile correctly at the player.
I found this formula: http://en.wikipedia.org/wiki/Trajectory_of_a_projectile but i have no idea how to implement it!
Any ideas?
Thanks