Sunday, March 7, 2010

AStarPathfinder Implementation - Custom collisions and terrain.

I previously posted a customizable AStarPathfinder class for my PandaXNA game engine. Here I'm going to post an example of how it is implemented into Gnome Mountain in a customized way. The gnomes need to use ladders to move up and down in the game, but of course the PandaXNA engine doesn't know this, and it doesn't need to know. By implementing the getNodeMovementPenalty function in a derived class, you can specify how movement and collisions work in your game, while still using the core path finding of PandaXNA.

Updated AStarPathfinder class: http://mage360.pastebin.com/ckXfaeBB

Gnome Mountain Implementation (GnomePathfinder.cs): http://mage360.pastebin.com/nrBdV2GQ

No comments:

Post a Comment