private void addPart(int gridX, int gridY, int dir, int amount) {
        Random random = new Random();
        amount += 2;
        if (gridY < cloudAtlas.length && gridX < cloudAtlas[0].length - 1 && gridX > -1 && gridY > -1) {
            //System.out.println("dir: " + dir + " adding cloud: " + gridX + "  " + gridY);
            cloudAtlas[gridX][gridY] = true;
            if (random.nextInt(50) < (200 / amount)) {
                switch (dir) {
                    case 1:
                        addPart(gridX, gridY + 1, dir, amount);
                        break;
                    case 2:
                        addPart(gridX + 1, gridY, dir, amount);
                        break;
                    case 3:
                        addPart(gridX, gridY - 1, dir, amount);
                        break;
                    case 4:
                        addPart(gridX - 1, gridY, dir, amount);
                        break;
                }
            }
        }
    }