A-Star Pathfinding in Objective-C
I decided to post this because when I first tried implementing A* I had a lot of trouble getting it up and running. There are plenty of tutorials and info on the A-Star algorithm but I never found any demos written specifically with Obj-C/Foundation classes (or even plain C for that matter).
So for any coders out there who may need to get A* running quickly in their apps (iPhone games?), here is a simple demo with source. (Please note: I tried to clean up the source a bit but the demo app was written as a quick proof-of-concept, so it’s a bit messy in parts. But it works and it should be easy to transplant the code into your own apps pretty quickly.)
Links:
Complete source and XCode project
The essential code snippets (Plain Text)
DemoView.m

