Hi,
I want to stop my sprite moving along a path when a specific distance from the end is reached (i.e. 300px from end point). Is this possible?
/Jamie
Compare two values:
distance(sprite.X,Sprite.Y,Sprite.Pathfinding.NodeXAt(Sprite.Pathfinding.NodeCount-1),Sprite.Pathfinding.NodeYAt(Sprite.Pathfinding.NodeCount-1))
<
300
=> Stop
Develop games in your browser. Powerful, performant & highly capable.
Thanks Katala, this worked great.