Skip to content
Snippets Groups Projects
Commit 7bcce29f authored by Tim Repke's avatar Tim Repke
Browse files

added pathfinder verbose mode which dumps the raster to console

parent 0a935d27
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,18 @@ PathFinder.prototype.generateRaster = function() {
};
}
}
if (Game.config.verbosePathFinder) {
var line = '';
for (var i = 0; i < this.raster.length; i++) {
line += i + ': ';
for (var j = 0; j < this.raster[i].length; j++) {
line += this.raster[i][j].walkable ? '#' : '-';
}
line += '\n';
}
console.log(line);
}
};
PathFinder.prototype.clearPathScore = function() {
var bbox = this.svg[0][0].getBBox();
......
......@@ -63,9 +63,10 @@
var maps = ['map_landing', 'castle_entrance', 'castle_fs', 'dorf'];
var game = new Game({
startMap: maps[0],
startMap: maps[UrlComponents.getValueOf('map') || 0],
showEventLayers: UrlComponents.isSet('showEventLayers'),
pathFindingGridSize: 5,
pathFindingGridSize: UrlComponents.isSet('verbosePF') ? 18 : 5,
verbosePathFinder: UrlComponents.isSet('verbosePF'),
usePathFinding: true,
size: [800, 600]
});
......
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