Skip to content

Commit

Permalink
Fixed bug with switch statements not breaking properly
Browse files Browse the repository at this point in the history
  • Loading branch information
fiicere committed Sep 26, 2012
1 parent c1b6809 commit ec2b7b3
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Mazebuilder/src/com/mazebuilder/root/GameplayState.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,39 +91,35 @@ public void keyPressed(int key, char c) {
case 'w':
if (chaser.canMove()){
board.movePlayer(chaser, Direction.UP);
break;
}
break;
case 'a':
if (chaser.canMove()){
board.movePlayer(chaser, Direction.LEFT);
break;
}
break;
case 's':
if (chaser.canMove()){
board.movePlayer(chaser, Direction.DOWN);
break;
}
break;
case 'd':
if (chaser.canMove()){
board.movePlayer(chaser, Direction.RIGHT);
break;
}
break;
// Special Moves
case 'W':
board.movePlayer(chaser, Direction.UP);
chaser.spendBonus(Direction.UP);
board.movePlayerWithBonus(chaser, Direction.UP);
break;
case 'A':
board.movePlayer(chaser, Direction.LEFT);
chaser.spendBonus(Direction.LEFT);
board.movePlayerWithBonus(chaser, Direction.LEFT);
break;
case 'S':
board.movePlayer(chaser, Direction.DOWN);
chaser.spendBonus(Direction.DOWN);
board.movePlayerWithBonus(chaser, Direction.DOWN);
break;
case 'D':
board.movePlayer(chaser, Direction.RIGHT);
chaser.spendBonus(Direction.RIGHT);
board.movePlayerWithBonus(chaser, Direction.RIGHT);
break;
case ' ':
runner.startTurn();
Expand Down

0 comments on commit ec2b7b3

Please sign in to comment.