A* pathfinding on a TMX tilemap

If you've skipped ahead to Chapter 8, Tips, Tools, and Ports, you'll see a recipe showing how to use the Tiled application with the TMX tilemap toolset. In this recipe, we create a 2.5D adventure game. To see our grid based pathfinding technique in action, we overload the Chapter 8, Tips, Tools, and Ports recipe entitled Creating levels using Tiled.

A* pathfinding on a TMX tilemap

Getting ready

Please refer to the project RecipeCollection03 for full working code of this recipe.

How to do it...

Execute the following code:

@interface Ch7_TileMapPathfinding : Ch8_TMXTilemap { NSMutableArray *grid; float actorRadius; } @end @implementation Ch7_TileMapPathfinding ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.