Long time lurker, first time poster.
Alright, here I am, trying to work out a world map engine for a game, and this is how the map system works.
A set of different cities, interconnected by many different paths. Clicking on one city will have the main character find the shortest path possible and proceed to walk that way. BFS I have no problem with, I am, however, a bit stumped on the animation portion. The character is supposed to walk along a “predestined” path. The path twists and turns, much like an actual road. I guess the best way to describe the effect I’m trying to achieve here is: Final Fantasy Tactics Advance.
As you can seen, they have a set of cities, connected by some pre-designated paths. The character turns up, down, left and right accordingly.
I’ve taken a look around (and at senocular’s dynamic path class), but I’m afraid that the paths are very “twisty” and not perfect bezier curves. Perhaps that might cause some problems? Additionally, I’m using ActionScript 3.0, which is bound to cause some compatibility problems with senocular’s code.
The simplest way I can see myself approaching this is having a set of different “paths” (lines) onstage, and dynamically “swap” the paths accordingly. However, after hours’ search (well, maybe just half an hour :P), I simply cannot find a built-in function for this. Maybe I overlooked something in the AS 3 library? I dunno, help me out here, guys.
Thank you very much,
TCAtect, desperate programmer