- #1
MrDoomMaster
- 2
- 0
Here is the scenario I am faced with:
I am developing a game that involves a main ship (the player) scrolling forward through a level firing at other ships that fly by.
There is a particular weapon the player has that will shoot a specific straight-moving projectile at a moving target. Since this moving projectile is slower than the ships move, the projectile needs to be fired in a way that it will "intersect" with the target at some point, thus hitting it no matter how fast it's going.
Instead of firing my projectile at the target's current location (which provides the target a way to easily dodge the projectile), the projectile needs to account the velocity of its target and fire at an angle that would cause it to "meet" the ship at a specific location in space.
I hope I've been detailed enough. I've been losing hair trying to visualize a formula for this. Thanks!
I am developing a game that involves a main ship (the player) scrolling forward through a level firing at other ships that fly by.
There is a particular weapon the player has that will shoot a specific straight-moving projectile at a moving target. Since this moving projectile is slower than the ships move, the projectile needs to be fired in a way that it will "intersect" with the target at some point, thus hitting it no matter how fast it's going.
Instead of firing my projectile at the target's current location (which provides the target a way to easily dodge the projectile), the projectile needs to account the velocity of its target and fire at an angle that would cause it to "meet" the ship at a specific location in space.
I hope I've been detailed enough. I've been losing hair trying to visualize a formula for this. Thanks!