Actor Path finding to touched location and avoides obstacles


Greetings! I am trying to create a game that the actor moves to where you touch, avoiding obstacles. A good example is Supermarket Mania. I have attached a picture for reference. The main actor moves from touched location to touched location delivering groceries, and most importantly the main actor walks around the obstacles while she moves from touched location to touched location.

In my quest to achieve this effect, I have researched this, and have not figured out to make this type of actor movement possible in GameSalad. I know it is possible, I just have not yet figured it out.

There is a lot of documentation/videos out there on this subject (path finding), but none of them I have found directly address have an actor (the hero) move to a specific location touched on the screen, and then have the actor move around obstacles to get to that point. I know this requires path finding. A path table, and a master table map, but I am lacking the know how to put it all together to make it work. To my understanding "Move To", "Move", and "interpolate" are insufficient to achieve the desired effect, as I do not want the actor to walk through other actors, but move around them on the way to the objective (the touched/mouse clicked screen location).

Instead of posting my code which is not working, the best thing I can provide for a starting point is a tutorial video on the subject I am using as a starting point. It is a great tutorial that helps explain path finding. However, it demonstrates how to "draw a path" and have an actor follow it, opposed to having an actor path find to a location you click on as I require for my game app. For reference here is a link to that tutorial: https://youtube.com/watch?v=jV21QXylByU. I have tried for days to re-write the code to achieve the desired effect, but so far I have not found a solution.

If anyone can help point me in the right direction, tutorial, article, video, demo file, it is greatly appreciated!

Thanks!

Comments

Sign In or Register to comment.