change image direction based on mouse motion

Jeffm2Jeffm2 Member, PRO Posts: 142

All,

I have an animated bird that has its x and y constrained to the x and y of the mouse so it follows the mouse. hat i would like to know is there a way to detect the mouse motion or when the x position is declining to be able to flip the animated bird so that it appears to be flying in the direction of the mouse?

There is no clicking or anything involved so far such as dragging or anything.


Thanks so much !!!

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    you could possibly use a timer that checks the x,y of the mouse position every 0.01 seconds, then calculate the angle between that and the previous x,y then rotate the bird to that angle.

Sign In or Register to comment.