Commit ff660aec authored by Terence Martin's avatar Terence Martin

Make maze regeneration a debug key

This should only happen while in debug mode, not during game mode. If
you're trying to play a game to test and you press the key by mistake,
it's the sad maker.
parent 0d43c88a
......@@ -108,7 +108,7 @@
<dd>Rotate player to facing; walk in direction</dd>
<dt>Spacebar</dt>
<dd>Push ball</dd>
<dt>? (on player's turn)</dt>
<dt>? (on player's turn, debugging off)</dt>
<dd>Get AI suggestion of ball to play</dd>
<dt>F12</dt>
<dd>Toggle debug/editing mode</dd>
......
......@@ -4810,7 +4810,7 @@ var nurdz;
case 191:
// If we're in debugging mode, don't handle the key here and
// let the debug code handle it instead.
if (this._maze.debugger.debugTracking)
if (this._debugger.debugTracking)
return false;
// Get the AI to select a ball. If one was selected, jump
// the player to that position, turn to face it, and push.
......@@ -4855,8 +4855,11 @@ var nurdz;
return true;
// Trigger a new maze generation.
case game.KeyCodes.KEY_G:
this._maze.generateMaze();
return true;
if (this._debugger.debugTracking) {
this._maze.generateMaze();
return true;
}
return false;
// Toggle mouse tracking of the debug location, then update the
// tracking with the last known mouse location.
case game.KeyCodes.KEY_F12:
......@@ -4957,7 +4960,7 @@ var nurdz;
this._mouse = this._stage.calculateMousePos(eventObj, this._mouse);
// If we're tracking a debug location, tell the maze about this
// point.
if (this._maze.debugger.debugTracking)
if (this._debugger.debugTracking)
this._maze.setDebugPoint(this._mouse);
// We handled it.
return true;
......
......@@ -254,7 +254,7 @@ module nurdz.game
case 191:
// If we're in debugging mode, don't handle the key here and
// let the debug code handle it instead.
if (this._maze.debugger.debugTracking)
if (this._debugger.debugTracking)
return false;
// Get the AI to select a ball. If one was selected, jump
......@@ -308,8 +308,12 @@ module nurdz.game
// Trigger a new maze generation.
case KeyCodes.KEY_G:
this._maze.generateMaze ();
return true;
if (this._debugger.debugTracking)
{
this._maze.generateMaze ();
return true;
}
return false;
// Toggle mouse tracking of the debug location, then update the
// tracking with the last known mouse location.
......@@ -430,7 +434,7 @@ module nurdz.game
// If we're tracking a debug location, tell the maze about this
// point.
if (this._maze.debugger.debugTracking)
if (this._debugger.debugTracking)
this._maze.setDebugPoint (this._mouse);
// We handled it.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment