3 ms·
If "trying to move closer" is enough, maybe you don't even need a pathfinding algorithm - if the target is to the right move one step to the right, if the targe
by ggambetta 12y ago
If "trying to move closer" is enough, maybe you don't even need a pathfinding algorithm - if the target is to the right move one step to the right, if the target is above move one step up, and so on?
- datashaman 12y agoWhat if there are obstacles in the path? You'll need a more complex algorithm to deal with the possibility of getting stuck in corners.
- ggambetta 12y agoWell, he did say "It doesn't really matter if it gets stuck".
- datashaman 12y agoputs glasses on ah. :-$
- Kiro 12y agoThat's basically what I have with the addition of a small collision check. If there is a collision tile between the seeker and the target it tries to move sideways but this has the effect that it only takes three adjacent tiles to stop the seeker from reaching the target. I would like something smarter than that but still preserve the efficiency.