Skip to main content
added 970 characters in body
Source Link

here is a link to my Final project that uses this classhere is a link to my Final project that uses this class (it's swf file which is uploaded online, so you can simply watch the output as long as you have flash player)
Make sure you watch this :
http://www.fastswf.com/HIa1W9M
hopefully what i said helps you.
Good luck.

here is a link to my Final project that uses this class
http://www.fastswf.com/HIa1W9M
hopefully what i said helps you.
Good luck.

here is a link to my Final project that uses this class (it's swf file which is uploaded online, so you can simply watch the output as long as you have flash player)
Make sure you watch this :
http://www.fastswf.com/HIa1W9M
hopefully what i said helps you.
Good luck.

added 970 characters in body
Source Link

hopefullyhere is a link to my Final project that uses this class
http://www.fastswf.com/HIa1W9M
hopefully what i said helps you.
Good luck.

hopefully what i said helps you.
Good luck.

here is a link to my Final project that uses this class
http://www.fastswf.com/HIa1W9M
hopefully what i said helps you.
Good luck.

added 970 characters in body
Source Link
//private var _heuristic: Function = manhattan;
//private var _heuristic: Function = euclidian;
 private var _heuristic: Function = diagonal;    

these are cost functions! each uses a different method, for example one uses,
if its left or right or top or bottom cell, it will cost 1 and if its topLeft, topRight, bottomLeft, bottomRight Cells it will cost 1.5 point, and it will uses these point to find the nearest path!
there is also custom costing as well ! why ? , for example every where is ground and some parts are water cells, you can say ground cells worth 1 point and water cells worth 3 point, meaning if you pass 3 ground cells it equals passing one water cell, and all these also will be considered in your nearest path Algorithm ,
and using it, you can easily make a game with different fields and paths
there is also

if (test == node || !test.walkable || !_grid.getNode(node.x, test.y).walkable || !_grid.getNode(test.x, node.y).walkable) continue;  

this part which has walkable variable for each node, hopefullyif its true, the node can be used as a path! and if its false that node IS NOT WALKABLE this way you can even build walls and impossible to walk objects in some cells

hopefully what i said helps you.
Good luck.

//private var _heuristic: Function = manhattan;
//private var _heuristic: Function = euclidian;
 private var _heuristic: Function = diagonal;  

these are cost functions! each uses a different method, for example one uses,
if its left or right or top or bottom cell, it will cost 1 and if its topLeft, topRight, bottomLeft, bottomRight Cells it will cost 1.5 point, and it will uses these point to find the nearest path!
there is also custom costing as well ! why ? , for example every where is ground and some parts are water cells, you can say ground cells worth 1 point and water cells worth 3 point, meaning if you pass 3 ground cells it equals passing one water cell, and all these also will be considered in your nearest path Algorithm ,
and using it, you can easily make a game with different fields and paths, hopefully what i said helps you.
Good luck.

//private var _heuristic: Function = manhattan;
//private var _heuristic: Function = euclidian;
 private var _heuristic: Function = diagonal;    

these are cost functions! each uses a different method, for example one uses,
if its left or right or top or bottom cell, it will cost 1 and if its topLeft, topRight, bottomLeft, bottomRight Cells it will cost 1.5 point, and it will uses these point to find the nearest path!
there is also custom costing as well ! why ? , for example every where is ground and some parts are water cells, you can say ground cells worth 1 point and water cells worth 3 point, meaning if you pass 3 ground cells it equals passing one water cell, and all these also will be considered in your nearest path Algorithm ,
and using it, you can easily make a game with different fields and paths
there is also

if (test == node || !test.walkable || !_grid.getNode(node.x, test.y).walkable || !_grid.getNode(test.x, node.y).walkable) continue;  

this part which has walkable variable for each node, if its true, the node can be used as a path! and if its false that node IS NOT WALKABLE this way you can even build walls and impossible to walk objects in some cells

hopefully what i said helps you.
Good luck.

added 970 characters in body
Source Link
Loading
Source Link
Loading