资 源 简 介
A potential Field library for AS3.
This library is built for path finding using a concept called "potential field" where each tile is labeled with a number. The number "0" is called the brightest tiles and to get to the brightest tile you look at the adjacent tiles for values lower than that of the current tile and move accordingly.
It can be used with any existing flash library.
Download here - https://code.google.com/p/as3-potentialfield/downloads/list
or get it here - http://pastebin.com/raw.php?i=L4KfBh0i
How to use:
1. Setup the potential field in the main class
var potentialfield:PotentialField;
2. Initialize the potential field inside the initialization function
potentialField = new PotentialField(); potentialField.loadMap(mapArray, MAP_WIDTH, MAP_HEIGHT); potentialField.generateField(new Point(2,2));
Where mapAr