How to calculate direction from initial point and another point?

Posted by Dvole on Game Development See other posts from Game Development or by Dvole
Published on 2014-08-19T19:57:50Z Indexed on 2014/08/19 22:35 UTC
Read the original article Hit count: 164

Filed under:

I'm making a simple game where I shoot things from a certain point on screen (A).

I tap the screen and shoot the projectile from initial point(A) to the tap point(B).

But I want the projectile to move along the same path instead and fly out of bounds of the screen.

How do I calculate a point that is on the same line that these two points, but further away?

This is a simple math, but I can't figure it out.

© Game Development or respective owner

Related posts about geometry