Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Click To Move
#2
From what I see, it is "You move in this direction while clicking", correct?

Has anyone done a "Click here and the engine will calculate the shortest path and walk there automatically"-type thing? That'd be pretty fun to see, too. Theres plenty of pathfinding guides and code out there, so that wouldn't be the hard part. Taking into account the fact that people can jump into your way may make things a little harder, though. Easiest way to go about it would to keep in memory the targeted (clicked) position and recalculate the path every tile a new tile is reached and just move one tile. You could probably optimize it a bit, though, by keeping a buffer of the path to travel, then after each movement to a new tile check if any of the path has been obstructed - if so, then recalculate.

Sorry, I digress. :wink:
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)