Cocos2d iOS A* Star Path finding help
- by user32581
Hello I need help implementing this class https://github.com/sqlboy/tiled-games/tree/master/src into my iOS game.
Im using the suggested code of:
AStarPathFinder pathFinder = [[AStarPathFinder alloc]
initWithTileMap:tileMap collideLayer:@"collide"];
// Optionally, you can set the name of the collide property key and the value it expects.
[pathFinder setCollideKey:@"collidable"] // defaults to COLLIDE
[pathFinder setCollideValue:@"True"] // defaults to 1
// highlight a path (src and dst are tile coorindates)
[pathFinder highlightPathFrom:srcTile to:dstTile];
// move a sprite
[pathFinder moveSprite:player from:srcTile to:dstTile atSpeed:0.1f];
I get the following error:
Instance method '-initWithTileMap:collideLayer:' not found (return defaults to 'id')
This is the official post for the class:
http://www.cocos2d-iphone.org/forums/topic/just-pushed-a-cctmxtiledmap-a-pathfinding-class-to-github/
The only other code I added was:
#import "AStarPathFinder.h"
I think I am perhaps missing something!
I am grateful for any help!