Skip to content

Commit

Permalink
Merge pull request #16 from DylanVanAssche/feature/ISSUE-14
Browse files Browse the repository at this point in the history
Feature/issue 14
  • Loading branch information
DylanVanAssche authored Dec 11, 2017
2 parents 8f9fa3b + 4433d6f commit 9b8e05b
Show file tree
Hide file tree
Showing 18 changed files with 458 additions and 182 deletions.
14 changes: 13 additions & 1 deletion src/be/dylanvanassche/maze/controller/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,17 @@ public void newGame() {
System.out.println(this.getMaze().getPlayer().getName());
this.getMainFrame().newGame();
}


public void movePlayer(MovementType movement) throws UnknownMovementDirection, BadMovementDirection, WeHaveAWinner {
try
{
this.getMaze().movePlayer(movement);
this.getMainFrame().updateGame();
}
catch(WeHaveAWinner exception)
{
this.getMainFrame().updateGame(); // Enforce update when reaching gold
throw new WeHaveAWinner(exception.getMessage());
}
}
}
Loading

0 comments on commit 9b8e05b

Please sign in to comment.