Hello all,
I just have a general question about the best way to implement a pathfinding system in Corona that can support live physics objects.
Here is some basic information to help you understand what I am trying to accomplish:
I am working on a real-time rogue-like game with some friends. The pathing is all worked out using Jumper. There are no issues with creating a path, or following the path using transitions. My issue lies in creating a system that allows physics objects to follow the path. There are wall tiles, projectiles, and player physics interactions that need to be handled by the object following the path, so I believe transitions are an incorrect way of approaching the problem (however, I have tried to use transitions and then cancel once it runs into something, but that seems to spawn way more issues than it fixes).
After deciding that transitions were no good, I moved to a full linear-velocity type approach. I thought that I would be able to simply check the distance of the physics object to the next path-node every frame, then progress to the next node when the object was close enough to the path-node. However, this became a problem because checking distance every frame produced highly variable results. The faster the object would be moving, the more imprecise the distance checks (I hope I am explaining this problem correctly).
My problem is how to detect when the object is ready to follow the next node. My next idea would be to place a little invisible physics pellet in the path-node, then simply update when it runs into it, but I’m not sure if that is too complicated of a solution…
Any suggestions of a simpler solution? Something obvious I am not thinking of?
Thanks!
Parker
