Quote:
Originally Posted by Crow
"tiles where we may stop" <-- Those tiles maybe?
|
If such is true... Then...
PHP Code:
allowedToWalk = new[level.width][level.height];
notAllowedToWalk = new[level.width][level.height];
allowedToStop = new[level.width][level.height];
tileShouldNotStop = new[level.width][level.height];
tileShouldStop = new[level.width][level.height];
tileShouldStop[ dest.x, dest.y ] = 1;
for ( (every tile in level) as tile)
{
allowedToWalk[ tile.x, tile.y ] = !onwall( tile.x, tile.y );
notAllowedToWalk[ tile.x, tile.y ] = onwall( tile.x, tile.y ); // Eh? Isn't this implicit from the last param?
tileShouldNotStop[ tile.x, tile.y ] = !tileShouldStop[tile.x, tile.y]; // Implicit?
}
findpathinarray(allowedToWalk, notAllowedToWalk, tileShouldStop, tileShouldNotStop, IdontKnow, startX, startY, 100);
That would be my best guess at the syntax. Though, I have done zero attempt to confirm this, and there is a Parameter that I am unsure about. ( This is pseudo-code. )