...
 
Commits (12)
  • Terence Martin's avatar
    Rename game scene · 4904b16a
    Terence Martin authored
    Rename the GameScene class to just be Game; that's what I normally do
    but in this case I appeneded the Scene name, which bothers me.
    4904b16a
  • Terence Martin's avatar
    Include a Game Over screen · ebcecd11
    Terence Martin authored
    This is also a take on the one from Devember 2015; here we display the
    game over text in the blank area at the top of the screen and allow a
    replay of the same game type as the last time or going back to the
    title screen.
    ebcecd11
  • Terence Martin's avatar
    Set up replay properly · a6da0704
    Terence Martin authored
    This properly replays the last played game using some new GameState
    functionality.
    a6da0704
  • Terence Martin's avatar
    Don't reset scores on maze generation · 48b264c2
    Terence Martin authored
    In a multi round game, this clears the score between rounds, which
    entirely defeats the purpose of a multi round game.
    48b264c2
  • Terence Martin's avatar
    Reset player positions at round start · d3ba6864
    Terence Martin authored
    Ensure that at round start, the human player is at the far left and
    the computer is at the far right.
    
    This looks nicer visually than having the player start a new game or
    round from the last seen position.
    d3ba6864
  • Terence Martin's avatar
    GameOver invokes update on previous scene · e8a1a969
    Terence Martin authored
    Since we're using the game scene rendering to draw the maze from the
    game over scene, also invoke it's update method so that the black
    holes will animate.
    e8a1a969
  • Terence Martin's avatar
    Randomly select the start player · 4ebf8b75
    Terence Martin authored
    After maze generation, instead of jumping directly to a state where we
    start the human player turn, we jump to a state where we randomly
    select who plays first and then transition to that state instead.
    4ebf8b75
  • Terence Martin's avatar
    Add computer ball toggle · cd46bc90
    Terence Martin authored
    Instead of having keys to selectively view either ball set, on the
    player's turn they can press a key to view the computer balls instead,
    to evaluate what the computer can possibly do.
    
    This is handled as an extra state, so that when the computer balls are
    visible, the player cannot move or play a ball.
    cd46bc90
  • Terence Martin's avatar
    Give Ball a lerp ability · f1c61522
    Terence Martin authored
    This gives the ball the visual ability to alter it's position linearly
    from it's current location to a final destination. This is currently
    done over a predefined number of ticks, since we are going to use it
    for a specific purpose.
    f1c61522
  • Terence Martin's avatar
    Add partial vanish animations to the Ball entity · a722e4f7
    Terence Martin authored
    This adds two new animations that are meant to be used to allow an
    action to happen in the middle of a ball vanish. One of them starts
    the vanish and the other finishes it.
    a722e4f7
  • Terence Martin's avatar
    Refactor score rendering · e425b5b3
    Terence Martin authored
    This shifts the position of where the two score values are rendered on
    the stage to be point values instead of hard coded values.
    e425b5b3
  • Terence Martin's avatar
    Use lerping in the score · 3fb04d59
    Terence Martin authored
    Finally all of the commits come together.
    
    Now when a ball has stopped moving and is going to be going away,
    instead of vanishing it, we use the new score start animation, which
    is a partial animation that shows the ball starting to vanish.
    
    Once that animation finishes (with the ball still half visible), we
    trigger the callback, which scores the ball, telling it to lerp to the
    location where the associated score is being displayed and also finish
    the vanish.
    
    The result is that the ball starts to vanish and then flies over to
    the score, allowing a bit of a visual clue that you got points for
    that ball.
    3fb04d59
......@@ -75,9 +75,10 @@
so this is more an exercise in replicating something and then extending it.
</p>
<p>To that end, once the core gameplay is completed, additional mechanics will be added
to the game in order to see how that changes things. Maybe we'll end up with something
better, or maybe we will not.
<p>To that end, once the core gameplay is completed,
additional mechanics will be added to the game in order
to see how that changes things. Maybe we'll end up with
something better, or maybe we will not.
</p>
<p>Some of the graphical assets used here are from (or based upon):
......@@ -102,10 +103,10 @@
<dl>
<dt>F</dt>
<dd>Toggle fullscreen mode on the canvas (if supported by the browser)</dd>
<dt>G</dt>
<dd>Regenerate the level</dd>
<dt>Left/Right/Down</dt>
<dd>Rotate player to facing; walk in direction</dd>
<dt>L</dt>
<dd>Toggle view of computer player unplayed balls</dd>
<dt>Spacebar</dt>
<dd>Push ball</dd>
<dt>? (on player's turn, debugging off)</dt>
......@@ -115,6 +116,8 @@
<dt>Left Click on a Ball</dt>
<dd>Drop ball into the maze</dd>
<h3>While in debug/editing mode:</h3>
<dt>G</dt>
<dd>Regenerate the level</dd>
<dt>?</dt>
<dd>Log info on selected maze cell</dd>
<dt>Left Click on Bonus/Gray Brick</dt>
......
This diff is collapsed.
......@@ -36,6 +36,12 @@ module nurdz.game
*/
export let maxRounds : number = 1;
/**
* Every time newGame is invoked, this is used to store the total rounds
* that were given to the method so that we can replay it easily.
*/
let lastGameType : number = 1;
/**
* The number of points the human player has.
*/
......@@ -46,6 +52,16 @@ module nurdz.game
*/
let computerScore : number = 0;
/**
* The location where the human score is displayed
*/
const humanScorePos = new Point (16, 32);
/**
* THe location where the computer score is displayed
*/
const computerScorePos = new Point (STAGE_WIDTH - (5 * 32), 32);
/**
* Set up a new game to be played over the given number of total rounds. A
* value of 0 or smaller means that we will be playing only a single round,
......@@ -58,6 +74,10 @@ module nurdz.game
*/
export function newGame (totalRounds : number) : void
{
// Save the information that is used to set this for the next time a
// replay happens.
lastGameType = totalRounds;
// Start at round one and store the total rounds given. When the total
// rounds is 0 or smaller, assume 1.
currentRound = 1;
......@@ -78,6 +98,16 @@ module nurdz.game
));
}
/**
* This sets everything up to the same game type specified the last time a
* new game was started. This can be used to replay the same type of game
* again without having to track how the game was set up.
*/
export function replayLastGame () : void
{
newGame (lastGameType);
}
/**
* Skip the round counter to indicate that we're in the next round now.
*/
......@@ -153,6 +183,20 @@ module nurdz.game
adjustScore (ball.player, BONUS_BRICK_SCORE);
}
/**
* Given a ball that is being scored for any reason, trigger a lerp on it
* that starts at the current location on the screen and terminates at the
* location where the score for this ball is displayed.
*
* @param {Ball} ball the ball which will update the score
*/
function lerpBallPos (ball : Ball) : void
{
ball.lerpTo ((ball.player == PlayerType.PLAYER_HUMAN)
? humanScorePos
: computerScorePos);
}
/**
* Score points due to a ball reaching the goal line (the bottom of the
* maze).
......@@ -162,6 +206,7 @@ module nurdz.game
export function goalBallScore (ball : Ball) : void
{
adjustScore (ball.player, GOAL_BALL_SCORE);
lerpBallPos (ball);
}
/**
......@@ -173,6 +218,7 @@ module nurdz.game
export function partialBallScore (ball : Ball) : void
{
adjustScore (ball.player, ball.mapPosition.y * BALL_POSITION_MULTIPLIER);
lerpBallPos (ball);
}
/**
......@@ -183,7 +229,7 @@ module nurdz.game
*/
export function renderScores (renderer : Renderer) : void
{
renderer.drawTxt (humanScore+"", 16, 32, "white");
renderer.drawTxt (computerScore+"", STAGE_WIDTH - (5 * 32), 32, "yellow");
renderer.drawTxt (humanScore+"", humanScorePos.x, humanScorePos.y, "white");
renderer.drawTxt (computerScore+"", computerScorePos.x, computerScorePos.y, "yellow");
}
}
\ No newline at end of file
......@@ -27,6 +27,14 @@ module nurdz.game
*/
MAZE_GENERATION,
/**
* We have finished generating a maze, so it's time to randomly select
* the player that will start the game. In this state we select the
* player and then transition to the state that checks to see if that
* player can make a move, which will start their turn.
*/
SELECT_START_PLAYER,
/**
* We want it to be the human player's turn. In this state we check to
* see if the human (or computer) can take a turn. If yes, the
......@@ -42,6 +50,14 @@ module nurdz.game
*/
PLAYER_TURN,
/**
* It is the player's turn, but they have pressed the key to see what
* balls the computer has. In this state no controls work so the player
* can't take a turn. When they press the button again, we skip to show
* the player balls and make it their turn again.
*/
PLAYER_VIEW_COMPUTER_BALLS,
/**
* We want it to be the computer player's turn. In this state we check
* to see if the computer (or human) can take a turn. If yes, the
......
module nurdz.game
{
/**
* How many update ticks a lerp should take to move the ball from it's
* original to final destination. This should be some number smaller than
* the time it takes a ball to vanish, or it will be gone before it gets
* there.
*/
const LERP_DURATION = 5;
/**
* This is used to indicate what type of ball this is. This is just for
* visual identification on the board.
......@@ -78,6 +86,25 @@ module nurdz.game
*/
private _savedScore : number;
/**
* When we are told to do a lerp to a new location on the screen, this
* stores the position that we originally started at.
*/
private _lerpStartPos : Point;
/**
* When we are told to do a lerp to a new location on the screen, this
* stores the position that we want to ultimately end up at.
*/
private _lerpEndPos : Point;
/**
* When we are doing a lerp, this is the engine tick that the lerp
* started at. A negative value here indicates that we are not currently
* trying to do a lerp.
*/
private _startLerpTick : number;
/**
* Get the type of ball that this is; this is used to set a visual
* representation of the ball
......@@ -191,15 +218,19 @@ module nurdz.game
// Set up all of the animations that will be used for this entity.
// There are two sets; one for the player ball and one for the
// computer ball.
this.addAnimation ("p_idle", 1, false, [10]);
this.addAnimation ("p_idle_gone", 1, false, [14]);
this.addAnimation ("p_vanish", 10, false, [10, 11, 12, 13, 14]);
this.addAnimation ("p_appear", 10, false, [14, 13, 12, 11, 10]);
this.addAnimation ("c_idle", 1, false, [15]);
this.addAnimation ("c_idle_gone", 1, false, [19]);
this.addAnimation ("c_vanish", 10, false, [15, 16, 17, 18, 19]);
this.addAnimation ("c_appear", 10, false, [19, 18, 17, 16, 15]);
this.addAnimation ("p_idle", 1, false, [10]);
this.addAnimation ("p_idle_gone", 1, false, [14]);
this.addAnimation ("p_vanish", 10, false, [10, 11, 12, 13, 14]);
this.addAnimation ("p_appear", 10, false, [14, 13, 12, 11, 10]);
this.addAnimation ("p_score_start", 10, false, [10, 11, 12]);
this.addAnimation ("p_score_end", 10, false, [12, 12, 12, 13, 14]);
this.addAnimation ("c_idle", 1, false, [15]);
this.addAnimation ("c_idle_gone", 1, false, [19]);
this.addAnimation ("c_vanish", 10, false, [15, 16, 17, 18, 19]);
this.addAnimation ("c_appear", 10, false, [19, 18, 17, 16, 15]);
this.addAnimation ("c_score_start", 10, false, [15, 16, 17]);
this.addAnimation ("c_score_end", 10, false, [17, 17, 17, 18, 19]);
// The ball is not hidden by default (the first animation in the list
// is the one that plays by default).
......@@ -216,6 +247,69 @@ module nurdz.game
// Create the point for our saved position during simulations.
this._savedPosition = new Point (0, 0);
this._savedScore = 0;
// No lerp to begin with.
this._startLerpTick = -1;
}
/**
* Initiate a lerp operation for this ball. The ball will start to move
* from its current location on the screen to the location provided over
* a predefined duration time. Once there the lerp will stop.
*
* Attempts to modify the ball position manually while the lerp is
* active will cause visual artifacts because the update loop will be
* manually updating the position along the way
*
* @param {Point} position the final destination location
*/
lerpTo (position : Point) : void
{
// Copy the current and final positions
this._lerpStartPos = this._position.copy ();
this._lerpEndPos = position.copy ();
// Save the current tick so we can time how long this is going for.
this._startLerpTick = this._stage.tick;
}
/**
* This is called every frame update (tick tells us how many times this
* has happened) to allow us to update ourselves.
*
* This invokes the superclass method, and then makes sure to also
* invoke the update method for our animated MazeCell entities, so that
* their animations will play as expected.
*
* @param {Stage} stage the stage that we are on
* @param {number} tick the current engine tick; this advances once for
* each frame update
*/
update (stage : Stage, tick : number) : void
{
// Let the super do it's thing for us.
super.update (stage, tick);
// Are we lerping?
if (this._startLerpTick > 0)
{
// Create the normalized value that tells us where along the
// position line we currently are.
let lerp = Utils.normalize (tick, this._startLerpTick,
this._startLerpTick + LERP_DURATION);
// Now use that value to shift our X and Y values. We make sure
// to clamp the values down so that we can accurately tell when
// we're done.
this._position.x = Math.floor (Utils.linearInterpolate (lerp,
this._lerpStartPos.x, this._lerpEndPos.x));
this._position.y = Math.floor (Utils.linearInterpolate (lerp,
this._lerpStartPos.y, this._lerpEndPos.y));
// If we have arrived at the final position, we're done now.
if (this._position.equals (this._lerpEndPos))
this._startLerpTick = -1;
}
}
/**
......@@ -255,6 +349,43 @@ module nurdz.game
this._hidden = true;
}
/**
* Set the visual state of the ball to a partial vanish; this plays an
* animation that causes the ball to vanish half way and then stop.
*
* This is identical to the vanish state, but the ball ends up not fully
* vanished (but still considered hidden).
*
* This is meant to be paired with scoreEnd() to add the ability to
* insert an action that happens in the middle of the animation.
*/
scoreStart () : void
{
this.playAnimation (this._ballType == BallType.BALL_PLAYER
? "p_score_start"
: "c_score_start");
this._hidden = true;
}
/**
* Set the visual state of the ball to the rest of a partial vanish;
* this plays an animation that causes the ball to finish fully
* vanishing and then stop.
*
* This is identical to the vanish state in that the ball finally ends
* up fully vanished.
*
* This is meant to be paired with scoreStart() to add the ability to
* insert an action that happens in the middle of the animation.
*/
scoreEnd () : void
{
this.playAnimation (this._ballType == BallType.BALL_PLAYER
? "p_score_end"
: "c_score_end");
this._hidden = true;
}
/**
* Set the visual state of the ball to appear; this plays an animation
* that causes the ball to transition from a hidden to idle state. This
......
......@@ -1066,7 +1066,7 @@ module nurdz.game
// becomes set to true doesn't happen until the ball is
// visibly gone.
if (pos.y == MAZE_HEIGHT - 2 || this._droppingFinalBall == true)
this._droppingBall.vanish ();
this._droppingBall.scoreStart ();
else
this._ballMoveFinalized = true;
......@@ -1259,9 +1259,6 @@ module nurdz.game
// automatic arrows too.
this._generator.generate (halfBalls, isLastRound ());
// Reset the scores
resetScores ();
// If there is a listener, tell it now that the generation has
// completed.
if (this._listener != null)
......
......@@ -77,8 +77,9 @@ module nurdz.main
setupButton (stage, "controlBtn");
// Register all of our scenes.
stage.addScene ("game", new game.GameScene (stage));
stage.addScene ("title", new game.TitleScreen (stage));
stage.addScene ("game", new game.Game (stage));
stage.addScene ("gameOver", new game.GameOver (stage));
// Switch to the initial scene, add a dot to display and then run the game.
stage.switchToScene ("title");
......
......@@ -18,9 +18,9 @@ module nurdz.game
* This scene represents the game screen, where the game will actually be
* played.
*/
export class GameScene extends Scene
implements StateMachineChangeListener,
MazeEventListener
export class Game extends Scene
implements StateMachineChangeListener,
MazeEventListener
{
/**
* Override the type of our renderer to be a canvas renderer.
......@@ -263,6 +263,16 @@ module nurdz.game
this._maze.pushBall (this._player.mapPosition.x);
return true;
// When the player presses the L key, we swap to showing the
// computer balls instead of the player balls. We also swap to
// a new state whose purposes is to make sure that we can only
// come back to this state and block player movement in the
// interim.
case KeyCodes.KEY_L:
this._maze.contents.showComputerBalls ();
this.state = GameState.PLAYER_VIEW_COMPUTER_BALLS;
return true;
// The question mark key; this is not in ts-game-engine yet.
case 191:
// If we're in debugging mode, don't handle the key here and
......@@ -358,22 +368,33 @@ module nurdz.game
return this._debugger.debugAddBrick ();
// Add an arrow to the maze at the current debug cursor; this
// only works if the cell is currentlye empty. This will add a
// only works if the cell is currently empty. This will add a
// normal arrow by default, but this can be toggled with the
// 'T" key'.
case KeyCodes.KEY_A:
return this._debugger.debugAddArrow ();
// Add a teleport to the maze at the current debug cursor; this
// only works if the cell is currentlye empty. This just adds an
// only works if the cell is currently empty. This just adds an
// extra exit point to the black hole system.
case KeyCodes.KEY_H:
return this._debugger.debugAddTeleport ();
// Add a ball to the maze at the current debug cursor; this only
// works if the cell is currently empty. This will add a player
// ball by default, but this can be toggled with the 'T' key.
// If we are viewing the computer balls, swap back to player
// balls and re-enable the player controls. Otherwise this key
// will add a ball if we're in debug mode.
case KeyCodes.KEY_L:
// If we are in the view computer ball state, then swap back
// to player balls and reset the state back to the player
// turn so that they can move again.
if (this.state == GameState.PLAYER_VIEW_COMPUTER_BALLS)
{
this._maze.contents.showPlayerBalls ();
this.state = GameState.PLAYER_TURN;
return true;
}
// Not viewing the computer balls, so maybe add a ball?
return this._debugger.debugAddBall ();
// Vanish away all of the gray or bonus bricks that are still
......@@ -390,16 +411,6 @@ module nurdz.game
// The question mark key; this is not in ts-game-engine yet.
case 191:
return this._debugger.debugShowContents ();
// For debugging purposes, this key swaps to human balls
case KeyCodes.KEY_Z:
this._maze.contents.showPlayerBalls ();
return true;
// For debugging purposes, this key swaps to computer balls.
case KeyCodes.KEY_X:
this._maze.contents.showComputerBalls ();
return true;
}
// We did not handle it
......@@ -493,9 +504,9 @@ module nurdz.game
*/
mazeGenerationComplete () : void
{
// For now, after maze generation it is always the human player's
// turn.
this.state = GameState.CHECK_VALID_PLAY_PLAYER;
// Skip to the state were we select what player will start the
// game.
this.state = GameState.SELECT_START_PLAYER;
}
/**
......@@ -536,12 +547,18 @@ module nurdz.game
{
// Did the ball reach the goal?
if (ball.mapPosition.y == MAZE_HEIGHT - 2)
{
goalBallScore (ball);
ball.scoreEnd ();
}
// The ball did not reach the goal, but if this is a final ball drop
// then score partial points for the ending position of the ball.
else if (isFinal == true)
{
partialBallScore (ball);
ball.scoreEnd ();
}
// Now that the ball is done, where we go depends on where we came
// from.
......@@ -664,6 +681,12 @@ module nurdz.game
this._player.visible = false;
this._computer.visible = false;
break;
// The game is over, so swap to that scene now.
case GameState.GAME_OVER:
this._stage.switchToScene ("gameOver");
break;
}
}
......@@ -686,12 +709,23 @@ module nurdz.game
// switch to the game over state. Otherwise, we can swap to the
// maze generation state for this round.
case GameState.BEGIN_ROUND:
this._player.jumpTo (1);
this._computer.jumpTo (MAZE_WIDTH - 1);
if (isGameOver ())
this.state = GameState.GAME_OVER;
else
this.state = GameState.MAZE_GENERATION;
break;
// We need to select a player to start off this round. Here we
// just randomly select one.
case GameState.SELECT_START_PLAYER:
if (Utils.randomIntInRange (1, 100) % 2 == 0)
this.state = GameState.CHECK_VALID_PLAY_PLAYER;
else
this.state = GameState.CHECK_VALID_PLAY_COMPUTER;
break;
// It is becoming the player's turn; check to see if there is
// a valid play for them; if yes, make it their turn. Otherwise,
// make it the computer turn.
......
module nurdz.game
{
/**
* The font that is used to display the main "Game Over" text.
*/
const MAIN_FONT = "32px Arial, Serif";
/**
* This class represents the game over screen. This is just a simple scene
* that jumps back to another scene after telling you that the game is over.
*
* This may be overkill in this particular prototype, but this is a good
* example of one method of de-cluttering the code by not having 100% of all
* visual logic in one place.
*/
export class GameOver extends Scene
{
/**
* As a supreme hack, redefine the property that defines our renderer so
* that the compiler knows that it is a canvas renderer. This allows us
* to get at its context so we can do things outside of what the current
* API allows for without having to noodle with the API more.
*/
protected _renderer : CanvasRenderer;
/**
* The scene that we assume is the game scene. This is really just a
* reference to the scene that had control before us, which should
* always be the game scene.
*
* We use this to do primary rendering, so that we can just mark up the
* screen a bit without having to replicate what the game scene is
* doing.
*/
private _gameScene : Game;
/**
* Our menu; this allows the user to determine if they will try the same
* game type again or go back to the title screen.
*/
private _menu : Menu;
/**
* Construct a new scene, giving it a name and a controlling stage.
*
* @param stage the stage that controls us.
*/
constructor (stage : Stage)
{
super ("gameOver", stage);
// Set up our menu
this._menu = new Menu (stage, "Arial,Serif", 20, null);
this._menu.addItem ("Play again", new Point (325, 50));
this._menu.addItem ("Quit", new Point (325, 80));
// No game scene by default
this._gameScene = null;
// Make sure it gets render and update requests.
this.addActor (this._menu);
}
/**
* This gets triggered when the stage changes from some other scene to
* our scene. We get told what the previously active scene was. We use
* this to capture the game scene so that we can get it to render
* itself.
*
* @param previousScene the previous scene
*/
activating (previousScene : Scene) : void
{
// Chain to the super so we get debug messages (otherwise not
// needed) about the scene change
super.activating (previousScene);
// Store the scene that preceeded us, if it was not the default
// scene
if (previousScene["_name"] != "defaultScene")
this._gameScene = <Game> previousScene;
}
/**
* Display some text centered horizontally and vertically around the
* point provided, using the given font and color.
*
* @param x the x position of the center of the location to draw the
* text
* @param y the y position of the center of the locaiton to draw the
* text
* @param text the text to render
* @param font the font to use to render the text
* @param color the color to render with
*/
private displayText (x : number, y : number, text : string, font : string, color : string)
{
// Put the origin at the text position.
this._renderer.translateAndRotate (x, y);
// Set the font and indicate that the text should be centered in both directions.
this._renderer.context.font = font;
this._renderer.context.textAlign = "center";
this._renderer.context.textBaseline = "middle";
// Draw the text and restore the context.
this._renderer.drawTxt (text, 0, 0, color);
this._renderer.restore ();
}
/**
* This is invoked once per update loop while this scene is the active
* scene
*
* @param {number} tick the game tick; this is a count of how many times
* the game loop has executed
*/
update (tick : number) : void
{
// Let the super do it's business, which updates all of our registered
// actors.
super.update (tick);
// If we have a game sceen, invoke it's update method so that
// things will animate like they should.
if (this._gameScene != null)
this._gameScene.update (tick);
}
/**
* Called to render our scene. We piggyback render on the scene that
* came before us so that we can display extra stuff on the stage
* without having to fully replicate everything that the other scene was
* doing.
*/
render () : void
{
// If we know what the game scene is, then allow it to render first,
// setting up the stage for us. As a fallback, clear the stage when
// we don't know how this works.
if (this._gameScene != null)
this._gameScene.render ();
else
this._renderer.clear ('black');
// Display our game over and press a key to restart text.
this.displayText (this._stage.width / 2, 32, "Game Over", MAIN_FONT, 'white');
// Get the menu to update
super.render ();
}
/**
* Invoked to handle a key press. We use this to tell the stage to
* switch to the game scene again from our scene.
*
* @param eventObj the event that tells us what key was pressed.
*
* @returns {boolean} always true
*/
inputKeyDown (eventObj : KeyboardEvent) : boolean
{
// If the super handles the key, we're done.
if (super.inputKeyDown (eventObj))
return true;
switch (eventObj.keyCode)
{
// Previous menu item (wraps around)
case KeyCodes.KEY_UP:
this._menu.selectPrevious ();
return true;
// Next menu item (wraps around)
case KeyCodes.KEY_DOWN:
this._menu.selectNext ();
return true;
// Select menu item; switches to either the title screen or the game screen depending on
// the item selected.
case KeyCodes.KEY_ENTER:
if (this._menu.selected == 0)
replayLastGame ();
this._stage.switchToScene (this._menu.selected == 0 ? "game" : "title");
return true;
}
return false;
}
}
}
......@@ -28,6 +28,7 @@
"entity/Maze.ts",
"scene/Title.ts",
"scene/Game.ts",
"scene/GameOver.ts",
"main.ts"
]
}