Курсовая работа: Java-гра Тетріс
private int[][] cells = new int[21][10];
public Glass() {
clearGlass();
}
public void clearGlass() {
for (int i = 0; i<cells.length; i++) {
for (int j = 0; j<cells[i].length; j++) {
cells[i][j] = (i==cells.length-1) ? 10 : 0;
}
}
}
public int getHeight() {
return cells.length;
}
public int getWidth() {
return cells[0].length;
}
public int getCell(int i, int j) {
return cells[i][j];
}
public void draw(Graphics g) {
g.setColor(Color.GRAY);
g.fillRect(10,0,300,600);
g.setColor(Color.BLUE);
g.fillPolygon(x,y,x.length);
for (int i = 0; i<cells.length-1; i++) {
for (int j = 0; j<cells[i].length; j++) {
drawCell(g,i,j);
}