예제 #1
0
 public boolean moveDown() {
   for (Cell cell : tetromino.getCells(this)) {
     if (isOccupied(cell.getCol(), cell.getRow() + 1)) return false;
   }
   tetromino.fall();
   return true;
 }
예제 #2
0
 public Cell getCell(int row, int col) {
   if (row < 0 || row >= HEIGHT || col < 0 || col >= WIDTH) {
     Cell a = new Cell(row, col);
     a.occupy();
     return a;
   }
   return board[col][row];
 }
예제 #3
0
 /** Déplace le tetromino vers la droite */
 public boolean moveRight() {
   for (Cell cell : tetromino.getCells(this))
     if (isOccupied(cell.getCol() + 1, cell.getRow())) return false;
   tetromino.moveRight();
   return true;
 }