Hi
I’m having lots of trouble coming up with a solution for this problem. I
have a player sprite and an enemy sprite. They are both located on a 2d
grid setup (each with x,y coords) - I need to find the angle between them.
I need this because they can both shoot at each other, they are using
"laser" weapons - where the ‘bullet’ is a straight line. I need the angle,
because I intend to use the excellant ‘rotoZoom’ library to rotate the
’bullet’ sprite according to the angle between the two sprites, so it looks
like the laser is in a straight line between them.
If I just fire the ‘bullet’, and they aren’t both on the same y coord then
it looks funny, like a straight line going at a angle.
I’ve spent ages searching the web for a algorithm to help me out - I came
across a DOT Product, but I’m not sure that’s what I want - can anybody help
???
Sorry if this is OT - but I’m out of ideas.
Thanks
David.