From 4394d4ad328fc7ce5be17ae39045dba2e640b1bd Mon Sep 17 00:00:00 2001 From: Manuel Herrmann <it@icetruck.de> Date: Fri, 18 Sep 2015 16:19:44 +0200 Subject: [PATCH] log path as pgm --- .../view/signups/game1/js/pathFinder.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/registration-system/view/signups/game1/js/pathFinder.js b/registration-system/view/signups/game1/js/pathFinder.js index 88d4638..d11ee50 100644 --- a/registration-system/view/signups/game1/js/pathFinder.js +++ b/registration-system/view/signups/game1/js/pathFinder.js @@ -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 +}; -- GitLab