Hallo to all.
I'm writing a couple of function for moving object across the screen;the difficult (for me) is that i don't know how to moving an object from poin A to point B.
If i decide that point a is (example) 200,100 and point b is the player position (example) 400,400 , how can i tell my enemy the direction that is going to follow?(all in pixel unit)
Example: enemy x100 y200
player x400 y400
enemy must go from x 100 y 200 to x400 y400 of one pixel at a time.
I think that math is involved (very very bad at that....) something like calculation of the angle of the distance ecc ecc is right?
If not there are other simplier method of doing this?
Thanks in advance.
I'm writing a couple of function for moving object across the screen;the difficult (for me) is that i don't know how to moving an object from poin A to point B.
If i decide that point a is (example) 200,100 and point b is the player position (example) 400,400 , how can i tell my enemy the direction that is going to follow?(all in pixel unit)
Example: enemy x100 y200
player x400 y400
enemy must go from x 100 y 200 to x400 y400 of one pixel at a time.
I think that math is involved (very very bad at that....) something like calculation of the angle of the distance ecc ecc is right?
If not there are other simplier method of doing this?
Thanks in advance.