Compare commits
3 Commits
Rotation_p
...
delete_whi
Author | SHA1 | Date | |
---|---|---|---|
ecdff3cbd0 | |||
fbd214bc23 | |||
d37059b7de |
@ -7,8 +7,6 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Random;
|
||||
|
||||
import static school_project.Piece.*;
|
||||
|
||||
public class MapGenerator {
|
||||
private static final Random rand = new Random();
|
||||
public enum Difficulty {
|
||||
@ -95,9 +93,7 @@ public class MapGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean[][] turnPiece = shape;
|
||||
|
||||
ret.addPiece(new Piece(turnPiece));
|
||||
ret.addPiece(new Piece(shape));
|
||||
}
|
||||
|
||||
//generate pieces
|
||||
|
@ -6,6 +6,9 @@ import javafx.scene.paint.Paint;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import static javafx.scene.paint.Color.WHITE;
|
||||
import static javafx.scene.paint.Color.color;
|
||||
|
||||
/**
|
||||
* Represent a Piece in the game.
|
||||
* Every Piece should be contained in a Map Object.
|
||||
@ -21,9 +24,9 @@ public class Piece extends Shape{
|
||||
public Piece(boolean[][] matrix) {
|
||||
super(matrix);
|
||||
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){
|
||||
color = p;
|
||||
}
|
||||
|
Reference in New Issue
Block a user