Compare commits

...

3 Commits

Author SHA1 Message Date
Mat
ecdff3cbd0 An other method to avoid all type of white
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Antho free to change this one I'm a little to lazy at this time
2023-05-18 00:32:48 +02:00
Mat
fbd214bc23 New condition for the while
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-05-17 23:59:40 +02:00
Mat
d37059b7de Add a condition to avoid white piece
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-05-17 23:49:21 +02:00

View File

@ -6,6 +6,9 @@ import javafx.scene.paint.Paint;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import static javafx.scene.paint.Color.WHITE;
import static javafx.scene.paint.Color.color;
/** /**
* Represent a Piece in the game. * Represent a Piece in the game.
* Every Piece should be contained in a Map Object. * Every Piece should be contained in a Map Object.
@ -21,9 +24,9 @@ public class Piece extends Shape{
public Piece(boolean[][] matrix) { public Piece(boolean[][] matrix) {
super(matrix); super(matrix);
Random rand = new Random(); Random rand = new Random();
color = new Color(rand.nextDouble(), rand.nextDouble(), rand.nextDouble(), 1); color = new Color((rand.nextDouble()%190), (rand.nextDouble()%190), (rand.nextDouble()%190), 1);
}
}
public void setColor(Paint p){ public void setColor(Paint p){
color = p; color = p;
} }