Original Post
ego.deltax=x2-x1;
ego.deltay=y2-y1;
float degree = atan2(ego.deltax,ego.deltay);
xinc=(float)cosf(degree*3.14/180);
yinc=(float)sinf(degree*3.14/180);
xinc*=4;
yinc*=4;
I got this code from another thread. I want the character to move in a *smooth* line towards the point where the player clicked. I did a bunch of bressenham stuff, but when the character is supposed to be moving 4 pixels at a time, it gets bumpy. So I''ve been doing a lot of looking around, and this is what I have come up with. The character only seems to move if you clicked to the upper right. I know that some of my previous posts have made you guys a little irritated because I have been asking really stupid questions, but I''d really like this to look good. Any help?
Muzlack Oofmay
