Ejemplo n.º 1
0
  public void fall() {
    Piece imaginary =
        new Piece(currentPiece.getX() + 1, currentPiece.getY(), currentPiece.getPiece_bits());
    boolean[][] tempResult =
        MatrixBoolean2DUtil.alignedNand(
            coordinates, currentPiece.getPiece_bits(), currentPiece.getX(), currentPiece.getY());
    boolean[][] tempCoordinates = MatrixBoolean2DUtil.and(coordinates, tempResult);

    if (roomExist(tempCoordinates, imaginary)) {
      coordinates = tempCoordinates;
      spawn(imaginary);
    } else {
      currentPiece.hitsBottom();

      checkForPoints();

      currentPiece = null;
    }
  }