createWall() {
minHeight = 10;
maxHeight = 30;
minWidth = 20;
maxWidth = 40;
width = Random.value * (maxWidth - minWidth) + minWidth;
height = Random.value * (maxHeight - minHeight) + minHeight;
// code to place wall
}
minDistanceBetweenWalls = 100;
distance = 0;
ticker() {
distance++;
if (distance > minDistanceBetweenWalls) {
// some chance to place wall
if (Random.value > .9) {
createWall();
distance = 0;
}
}
}