ajout du score et nombre de lignes supprimés dans la vue + vue gameover

This commit is contained in:
ROGER
2025-05-20 12:38:23 +02:00
parent e93b1cfb64
commit abd6ae07c8
4 changed files with 84 additions and 5 deletions

View File

@@ -11,6 +11,8 @@ import org.Models.Pieces.PieceO;
import org.Models.Pieces.PieceS;
import org.Models.Pieces.PieceT;
import org.Models.Pieces.PieceZ;
import org.Views.VueGameOver;
import org.Views.VueTetris;
@SuppressWarnings("deprecation")
public class Jeu extends Observable implements Runnable {
@@ -40,7 +42,7 @@ public class Jeu extends Observable implements Runnable {
private PieceCourante getNouvellePiece() {
Random random = new Random();
int randomiiii = random.nextInt(6);
int randomiiii = random.nextInt(7);
System.err.println("randomiiiii : " + randomiiii);
PieceCourante nouvellePiece;
@@ -100,6 +102,9 @@ public class Jeu extends Observable implements Runnable {
public boolean estFinPartie() {
for (Point caseColoree : this.grille.motifPieceCouranteColoriee()) {
if (this.grille.getCase(caseColoree.y, caseColoree.x)) {
new VueGameOver(grille.getScore(),e -> System.exit(0),e->{
System.out.println("Début d'une nouvelle partie");
});
return true;
}
}