I have two arrays containing the x and y positions of two points - the target position and the origin position. To move a point along this vector, would I be correct to assume that the code below would be the correct calculation and method to use? I'm asking because it seems to be creating unexpected problems when I use it in my game.
Well, the problem is that the dotPos coordinates seem to ignore my collision check when the vector line is completely horizontal. I thought that maybe my collision check was wrong, but it works in all other functions exactly the way it is supposed to without fault, so in my mind it can only be a problem with the vector.
Fixed problem by offsetting the origin y coordinate of the vector so that it can never be horizontal. How strange...