destroy players on game end

This commit is contained in:
Luca Conte 2024-12-20 17:57:50 +01:00
parent 7f610b4a90
commit b7215db6d9
2 changed files with 5 additions and 0 deletions

View File

@ -221,5 +221,8 @@ public class GameBoard extends JPanel {
public Player getP1() {
return p1;
}
public Player getP2() {
return p2;
}
}

View File

@ -151,6 +151,8 @@ public class MainFrame extends JFrame {
if(player != gameBoard.getP1()){
return;
}
this.gameBoard.getP1().destroy();
this.gameBoard.getP2().destroy();
LooseScreen looseScreen = new LooseScreen(this);
mainPanel.add(looseScreen,panelName);
mainPanel.revalidate();