Skip to content
Snippets Groups Projects
Commit 4394d4ad authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

log path as pgm

parent aeb5ed9f
No related branches found
No related tags found
No related merge requests found
......@@ -50,14 +50,21 @@ PathFinder.prototype.generateRaster = function() {
}
if (Game.config.verbosePathFinder) {
var line = '';
var pgm = "P5\n";
pgm += this.raster[0].length+' '+this.raster.length+'\n';
pgm += "255\n";
for (var i = 0; i < this.raster.length; i++) {
line += i + ': ';
//line += i + ': ';
for (var j = 0; j < this.raster[i].length; j++) {
line += this.raster[i][j].walkable ? '#' : '-';
pgm += this.raster[i][j].walkable ? ' ' : '~';
}
line += '\n';
//line += '';
}
var line = '\n';
line += "--- .PGM DATA ---\n";
line += pgm;
line += '\n--- .PGM DATA END ---\n';
console.log(line);
}
};
......@@ -187,4 +194,4 @@ PathFinder.prototype.canWalkOn = function(x, y) {
}
}
return canWalk;
};
\ No newline at end of file
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment