Hblade wrote:An example code:
Using angle with directional_velocity
- Code: Select all
angle=direction(x, y, actor.x, actor.y);
directional_velocity=5;
This will move to an actor at a velocity of 5. You can also "ease in/out" to an actor by using directional_velocity=distance(x, y, actor.x, actor.y)/2;.
Thanks for the explanation. I'm still not sure as to what the "angle" variable does, though, and how it is different from any user defined variable. I mean if this is a standard in-game variable, then what does it affect? Does it rotate an object or just store the value of direction(x, y, actor.x, actor.y) like any user defined variable would do?
Can this angle variable be used specific to a particular actor (eg., MyActor.angle)?