Made maze code place blocks 2 high

This commit is contained in:
walterhiggins 2014-03-14 22:23:35 +00:00
parent edf249a418
commit 9d406dbb44
2 changed files with 6 additions and 6 deletions

View file

@ -598,8 +598,8 @@ function __onEnable ( __engine, __plugin, __script )
jsPluginsRootDirName, jsPluginsRootDirName,
modulePaths, modulePaths,
requireHooks, requireHooks,
function(code){ function( code ) {
return __engine.eval(code); return __engine.eval( code );
} }
); );

View file

@ -74,7 +74,7 @@ function maze_display(m) {
// You might also consider creating a new maze_display but for now this will do the work // You might also consider creating a new maze_display but for now this will do the work
function maze_draw(maze_string, d) { function maze_draw(maze_string, d) {
// d is the Drone to use // d is the Drone to use
d.up().chkpt('maze-start'); d.chkpt('maze-start');
for (var j = 0; j < maze_string.length; j += 2) { for (var j = 0; j < maze_string.length; j += 2) {
switch(maze_string.substr(j, 2)) { switch(maze_string.substr(j, 2)) {
case ' ': case ' ':
@ -86,11 +86,11 @@ function maze_draw(maze_string, d) {
break; break;
default: // '+ ', '+-', '--', '| ' default: // '+ ', '+-', '--', '| '
if (j == 0) { if (j == 0) {
d.box(blocks.glowstone); // highlight the maze entry and exit d.box(blocks.glowstone,1,2,1); // highlight the maze entry and exit
} else if (j == maze_string.length - 4) { } else if (j == maze_string.length - 4) {
d.box(blocks.glass); d.box(blocks.glass,1,2,1);
} else { } else {
d.box(blocks.oak); d.box(blocks.oak,1,2,1);
} }
d.fwd(); d.fwd();
} }