MATTREAGAN
iOS & macOS engineer,
designer, game creator
Author: Matt Reagan
« Previous | Next »

A* Pathfinding Algorithm
This article was originally posted on my HumbleBee Blog in 2012, and republished here. Please excuse any old or broken links.

A-star (A*) is a pathfinding algorithm commonly used in games and artificial intelligence systems. It can be tricky to implement for those unfamiliar with it, however. When I was first attempting to implement it years ago I was unable to find any examples in Objective-C (or C).

The following Objective-C code and demo project demonstrate how to implement A* in your iOS or Mac apps using common foundation classes.

This code is a little very old and could use some a lot of improvement, but hopefully it will provide a helpful starting point for anyone looking to implement pathfinding in their games or apps.

Github Project

Download the Xcode Project

The code

Visual demo of the Xcode project: