Walking the path.
BlitzMax Forums/BlitzMax Programming/Walking the path.
| ||
Hey guys, I've been working on an a* pathfinding algorithm. It can find a path, but I just have one problem... walking the path! Can anyone give me a good example on how to walk the path? EDIT: By walking the path, I mean having a sprite run across the path. |
| ||
Depends what data your path holds. If it's the usual sort of thing, where you've grid nodes in order, you can effectively traverse them like a linked list. Cheers Charlie |
| ||
How do I move to them? Is it just something like this:if playerx > node.x playerx:- 1 'repeat for the other moves... |
| ||
Why not just have the character move from one node to the next |
| ||
Oh, that's what I did, but it didn't work. But now looking at it, I found an error! Thanks guys for your help! |
| ||
why not post your code so we can see how you're doing it. A* can be implemented in a lot of different ways. Cheers Charlie |