Closed vitalitymobile closed 11 years ago
Hi @vitalitymobile, Well, that's a little issue I planned to fix, since it occurs on very specific cases (more precisely when the first step goes from an unwalkable node) but for some reasons I lost track of it on my to-do list. Thanks poiting it out, though. I'll push a commit as soon as I reach my workstation.
PS: Looking at the example you provided, it seems you're using an outdated version of Jumper. I strongly recommend to move to the latest stable (1.8.0). They have been a few changes. You can take a look at the Readme for usage examples and verbose explanations.
Thanks for your feedback.
Thanks for your quick reply. Another question, In each move step, do I have to call an init Jumper like this:
self.pather = Jumper(map,self.walkable,self.postProcess) local path = self.pather:getPath(sx,sy,ex,ey);
Or is there any way to simple call getPath when need ( ofcourse the map logic change before call)
Unless I totally missed what you meant saying map logic change before call
, I'd rather say no, you don't need this at all. You might want to explain the idea a little more, though.
Thanks.
Yes, sorry for my bad of English In my game, after user make a correct move, i update map table, and when user going to another move, i must check for path, so my question is in this case, do i have to call self.pather = Jumper(map,self.walkable,self.postProcess) again
or just call local path = self.pather:getPath(sx,sy,ex,ey);
Thanks!
Updating the map won't require to init again a new pathFinder instance, as in the code, while processing a path computation, the pathFinder will always check for each node being expanded if it is walkable or not. On the fly.
That's a feature added as of v1.6.3.
So, well, you won't need to init anything again if you're using this version, or more recent. Just keep calling getPath
.
I would like to add that Jumper works deadly fast! I the game that I am currently working on I am calling getPath three times per second and there is no visible slowdown at all. Great work!
Thanks Yonaba, now I understand it! Please fix the bug soon so I can use it in my next game! Can I quick fix this by set the starting node to walkable?
It works like a charm now! Thanks you so much Yonaba!
Hi Yonaba, I am using Jumper in my project and setup the map like bellow. But when i try to move gem from 5,3 to 4,3 (that i think it nearby and possible to move) it show can not move. Can you check it?
Thanks!