protected void calculateCorners(double x, double y) {
        int leftTile = (int) (x - width / 2) / tileSize;
        int rightTile = (int) (x + width / 2 - 1) / tileSize;
        int topTile = (int) (y - height / 2) / tileSize;
        int bottomTile = (int) (y + height / 2 - 1) / tileSize;
        if (topTile < 0 || bottomTile >= tileMap.getRows() || leftTile < 0 || rightTile >= tileMap.getCols()) {
            topLeft = topRight = bottomLeft = bottomRight = false;
            return;
        }
        int tl = tileMap.getType(topTile, leftTile);
        int tr = tileMap.getType(topTile, rightTile);
        int bl = tileMap.getType(bottomTile, leftTile);
        int br = tileMap.getType(bottomTile, rightTile);
        topLeft = tl == Tile.BLOCKED;
        topRight = tr == Tile.BLOCKED;
        bottomLeft = bl == Tile.BLOCKED;
        bottomRight = br == Tile.BLOCKED;
    }