}
}
}
if (cTotal - cHerobrine == 0 ) {
// Award the winner the game and exit
Player victor =
Player1.getScore() > Player2.getScore()
? Player1
: Player2;
victor.giveWin();
GamePanel.get().updateLabels();
// Play victory sound (eat for a second then burp) :)
try {
Card.Clips.get("Eat").loop();
TimeUnit.SECONDS.sleep(1);
Card.Clips.get("Eat").stop();
} catch (InterruptedException ie) {
Card.Clips.get("Eat").stop();
}
Card.Clips.get("Burp").play();
// Show Congratulatory Message
JOptionPane.showMessageDialog(
MainFrame.get(),
"Congratulations " + victor.getName() + "!",
"You Won",
JOptionPane.INFORMATION_MESSAGE
);
// Set ActiveGame to null