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
I should clarify, I do not want the main actor, the hero to walk through furniture. I am okay with the actor walking though other moving actors. That slight nuance might affect the answers received on this question. Thanks!
@dbratley66
have you looked at this:
http://help.gamesalad.com/gamesalad-cookbook/2-making-it-better/a-pathfinding/
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Our free maze pathfinding template might help you in the right direction.
http://www.gsinvention.com/product/maze-pathfinding/
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
I have a tutorial on a very simple form of obstacle avoidance if you want to check it out:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Pathfinding might be the way to go, but for something as simple as the example you give, I'd probably just pre-program paths in for the various paths the characters might take. They seem to be limited in number and not complex.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support