2d game : fire at a moving target by predicting intersection of projectile and unit

后端 未结 11 762
庸人自扰
庸人自扰 2020-11-28 22:26

Okay, this all takes place in a nice and simple 2D world... :)

Suppose I have a static object A at position Apos, and a linearly moving object B at Bpos with bVeloci

11条回答
  •  一整个雨季
    2020-11-28 22:41

    Basically , intersection concept is not really needed here, As far as you are using projectile motion, you just need to hit at a particular angle and instantiate at the time of shooting so that you get the exact distance of your target from the Source and then once you have the distance, you can calculate the appropriate velocity with which it should shot in order to hit the Target.

    The following link makes teh concept clear and is considered helpful, might help: Projectile motion to always hit a moving target

提交回复
热议问题