In my 2D game I have AI turrets that should assist the player by automatically firing towards enemies. I would like to make them fire intelligently and lead their target instead of just targeting an enemy's current position. So, given the (always constant) velocity and position vector of both the enemy and the turret's projectile, how can I find a vector that represents the actual position the turret must target in order for the projectile to intersect (and hit) the enemy?
Any links to articles that describe the math, algorithms, etc. would be appreciated!
Answer
This question on GameDev, and this question on StackOverflow should provide you with the answer you're looking for. :)
No comments:
Post a Comment