Skip to content

Commit

Permalink
Merge pull request #79 from sreese25/master
Browse files Browse the repository at this point in the history
Enter after the last level sends you to the credits
  • Loading branch information
sreese25 committed Apr 8, 2012
2 parents 8045331 + 37f2bb6 commit d8c220b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/com/vulcastudios/states/TransitionState.java
Expand Up @@ -41,9 +41,13 @@ public void update(GameContainer container, StateBasedGame game, int g)
if (container.getInput().isKeyPressed(Input.KEY_ESCAPE)) {
game.enterState(TestGame.MAIN_MENU_STATE_ID);
}
else if (!((TestGame)game).isOnLastLevel() && container.getInput().isKeyPressed(Input.KEY_ENTER)) {
((TestGame)game).goToNextLevel();
game.enterState(TestGame.IN_GAME_STATE);
else if (container.getInput().isKeyPressed(Input.KEY_ENTER)) {
if (((TestGame)game).isOnLastLevel()) {
game.enterState(TestGame.CREDITS_STATE);
} else {
((TestGame)game).goToNextLevel();
game.enterState(TestGame.IN_GAME_STATE);
}
}
}

Expand Down

0 comments on commit d8c220b

Please sign in to comment.