Skip to content

Commit

Permalink
Score!
Browse files Browse the repository at this point in the history
  • Loading branch information
lwoollett committed May 25, 2017
1 parent f5bab62 commit c06c470
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gui/GameGUI.java
Expand Up @@ -594,6 +594,13 @@ public void mouseReleased(MouseEvent arg0) {
btnEndDay.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent arg0) {
if(day == maxdays && pcounter == players.size()-1){
String gamestring = "Game Over. Player Scores:\n";
for(Player p:players){
gamestring += "\n Player: " + p.getName() + "'s Score: " + p.getScore();
}
JOptionPane.showMessageDialog(frmVirtualPets, gamestring);
}
pcounter += 1;
if(pcounter > players.size()-1){
pcounter = 0;
Expand Down

0 comments on commit c06c470

Please sign in to comment.