I am working on a game where I move sprites on a path that may change (depending on the user):
Here's what I have so far:
1.) A Pathfinding algorithm that spits out waypoints
2.) Sprites move along the waypoints
Here's what I'm having trouble with:
How do I update the sprites to follow the new path when the path (waypoints) have been updated? I am using a simple NSNotification and doing the following:
//Pseudo code
[sprite stopAllActions]
for loop{
CCAction *myAction = [CCMoveTo ....]
[arrayOfActions addObject: myAction]
}
[sprite run sequence of actions: arrayOfActions]
//End pseudo code
Anyone have any ideas how I can go about this? Would using a Physics engine make sense?