Could anyone give me an example of source code which uses astar pathfinding algorithm with AndEngine on the TMXTiledMap. I am using AndEngine downloaded from https://github.com/nicolasgramlich/AndEngine.
Any suggestion would be appreciated. Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the official TMXTiledMapExample, but it doesn’t contain A* pathfinding. It can teach you about tiled maps, though.
Here is another example from the forums which does contain it. It isn’t really an example, but the pathfinding code provided there works. I don’t think there is any real example of A* pathfinding, never seen any tutorial of it (The best way to learn is to read the code yourself. Better take a look at AStarPathFinder.java code).
The important parts for you in the forum post are are (lines):
123: Initializing the
AStarPathFinder205 – 213: Converting screen/scene coordinates to map tiles and using the pathfinder.
224: The method
loadPathFound– using the path returned by the pathfinder to move an entity.The
MyMapclass in the third post.