I wanted to check whether is an efficient way in which to check the value of the "angle" variable in a game. The angle variable doesn't seem to be calculated with respect to the X-axis immediately after the MoveTo function is executed. In fact, at this point, it only shows the angle between the previous direction of motion and the subsequent direction of motion. For example, if the actor is moving at 45 degrees to the X-axis and a mouse down event causes it to move at 90 degrees to the X-axis, the angle variable's value immediately after the mouse down event is 45. However, the value displays correctly after a fraction of a second.
However, setting a timer to consistently check the value of the angle variable to update the actor's animation does not seem to be performance friendly. Take into account that there may well be several actors on a screen and its easy to understand that there may be a significant overhead associated with this kind of approach. Does anyone have any suggestion regarding a more performance friendly approach that can automatically change the actor;s animation when the value of the angle variable changes? The unit will not be travelling along a straight line and will be walking around obstacles without a mouse down event for every change in direction.