Hey, I am looking to create something similar to the resource system in creeper world, ultimately I want little resource packets (sprites) to travel along pathways between nodes to their destination as required - See example https://youtu.be/XtHgFz-d4TY?t=1215 or even something like this old flash game (The Space Game) https://youtu.be/VI6smKzHuHQ?t=778
I've had a little look around the forums & haven't found anything similar. If someone can direct me to an example or give me some tips as to where to start on the research for this I'd greatly appreciate it.
The pathfinder behavior works by dividing the level up into squares and uses the a star algorithm to find the closest path. You can implement a star with events to use a node mesh. This site is a great reference:
Looking through my files I found two examples of that. The first is newer, but I included the older one in case that gives ideas.
So basically if you used the first one, just place nodes and lines between them to make connections. Then calling the "astar" function with the uid of the start and end nodes will give you a comma separated list of the nodes that would make up the quickest path.
The latter part of the example gives a possible way to move the object through that list of nodes. There are other ways.
Develop games in your browser. Powerful, performant & highly capable.
Ah yes this is the good stuff!