|
@ -24,13 +24,18 @@ public class Scoreboard extends JLabel{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void updateScores() { |
|
|
public void updateScores() { |
|
|
|
|
|
int gamesPlayed = 0; |
|
|
for(int i = 0; i < playerPoints.length; i++){ |
|
|
for(int i = 0; i < playerPoints.length; i++){ |
|
|
if(i == 0) { |
|
|
if(i == 0) { |
|
|
setText("Draws: " + playerPoints[0]); |
|
|
setText("Draws: " + playerPoints[0]); |
|
|
} else { |
|
|
} else { |
|
|
setText(getText() + " Player " + i + ": " + playerPoints[i]); |
|
|
setText(getText() + " Player " + i + ": " + playerPoints[i]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gamesPlayed += playerPoints[i]; |
|
|
} |
|
|
} |
|
|
|
|
|
setText(getText() + " Games played: " + gamesPlayed); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|