Thread: findpathinarray
View Single Post
  #6  
Old 12-06-2007, 12:10 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by Crow View Post
"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. )
Reply With Quote