|
@ -30,7 +30,7 @@ public class Controller { |
|
|
this.appleModel = appleModel; |
|
|
this.appleModel = appleModel; |
|
|
this.appleView = appleView; |
|
|
this.appleView = appleView; |
|
|
|
|
|
|
|
|
scoreView = new TextView("Scores: 9", new Point(15, 15)); |
|
|
|
|
|
|
|
|
scoreView = new TextView("Scores: 0", new Point(15, 15)); |
|
|
messageView = new TextView("Click 'Start Game' to Begin . (W-up, S-down, A-left, D-Right)", |
|
|
messageView = new TextView("Click 'Start Game' to Begin . (W-up, S-down, A-left, D-Right)", |
|
|
new Point(gameView.getWidth()/2, gameView.getHeight() - 15)); |
|
|
new Point(gameView.getWidth()/2, gameView.getHeight() - 15)); |
|
|
|
|
|
|
|
@ -147,7 +147,7 @@ public class Controller { |
|
|
checkIfAppleWasEaten(); |
|
|
checkIfAppleWasEaten(); |
|
|
if(snakeModel.isSelfColliding()) |
|
|
if(snakeModel.isSelfColliding()) |
|
|
{ |
|
|
{ |
|
|
messageView.setText("You Lose! Click 'Start Game' to play agaiin."); |
|
|
|
|
|
|
|
|
messageView.setText("You Lose! Click 'Start Game' to play again."); |
|
|
messageView.setVisibility(true); |
|
|
messageView.setVisibility(true); |
|
|
gameState = GameState.PlayerLosed; |
|
|
gameState = GameState.PlayerLosed; |
|
|
timer.stop(); |
|
|
timer.stop(); |
|
|