CNA Samples

Pathfinding

Ported from Microsoft's XNA 4.0 Pathfinding sample.

Source for this sample on GitHub ↗

A tank searches a checkerboard map, with green candidate nodes, red visited nodes and a pathfinding status display. Play ▸

Opens in a new tab. Press A to start the search.

About this sample

Breadth-first, best-first and A* search look for a route across four tile maps. Green dots mark nodes available to search; red dots mark nodes already visited. When a route is found, the tank follows its waypoints to the destination.

Controls

ActionKeyboardGamepad
Start or stop searchingAA
Reset the current mapBB
Change search methodXX
Next mapYY
Adjust time stepLeft / RightD-pad Left / Right