Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

Pathfinding, need feedback

$
0
0

I started work on the pathfinding algorithm. I know the stages of the algorithm (how it should look like in the end), bellow is almost pseudocode (it`s real code but I haven`t started building/debugging)

void FindPath(int Startx, int Startz, int Endx, int Endz)
{
Careux = Startx;
Careuz = Startz;
Node.access = Chart[(Careuz+1)*10+Careux].access;
Node.x = Chart[(Careuz+1)*10+Careux].x;
int SurroundingsDistance[8];
for(int i  = 0; i < 8; i++)
{
 SurroundingsDistance[i] = -1;  
}
if(NodeCoord(Startx, Startz +1).access)//N
{
 
 Distancex = NodeCoord(Startx, Startz +1).x - Endx;
 if(Distancex < 0)
 {
  Distancex …

Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>