From ec2b7b3cff56d679cc1b46791881755aa5162471 Mon Sep 17 00:00:00 2001 From: fiicere Date: Wed, 26 Sep 2012 03:29:24 -0400 Subject: [PATCH] Fixed bug with switch statements not breaking properly --- .../com/mazebuilder/root/GameplayState.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Mazebuilder/src/com/mazebuilder/root/GameplayState.java b/Mazebuilder/src/com/mazebuilder/root/GameplayState.java index ee63a92..5649ebd 100644 --- a/Mazebuilder/src/com/mazebuilder/root/GameplayState.java +++ b/Mazebuilder/src/com/mazebuilder/root/GameplayState.java @@ -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();