Complete overhaul of Application & ApplicationFrame so that game can end

This commit is contained in:
2016-05-13 20:04:20 +02:00
parent 5585028819
commit 3be072e282
3 changed files with 44 additions and 11 deletions

View File

@ -58,6 +58,28 @@ public class Game {
}
public void stopGame(GameoverCause cause) {
switch (cause){
case TIMEOUT:
JOptionPane.showMessageDialog(null, "Time is up! Anubis has enslaved the world by now.",
"Game over",
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon("Anubis.png"));
Application.frameInstance.backToMapSelection();
break;
case ONEILLWON:
JOptionPane.showMessageDialog(null, "Colonel O'Neill won!", "Game over",
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon("Deal_with_iit.png"));
Application.frameInstance.backToMapSelection();
break;
case JAFFAWON:
JOptionPane.showMessageDialog(null, "Jaffa won!", "Game over",
JOptionPane.INFORMATION_MESSAGE,
new ImageIcon("Deal_with_iit.png"));
Application.frameInstance.backToMapSelection();
break;
}
}
public void moveONeill(Direction direction) {