Night-ish city scape, but no cars or streetlights yet... Its rather convoluted because I was getting into drawing order issues that made the buildings look rather escher-like.
enjoy!
Code: Select all
startshape citystart
rule citystart{base{y -1} cityfirst{x 1}}
// make sure there's at least one building...
rule cityfirst {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} base {y -1 x 4} base {y -1 x 5} 5column{} city{x 6}}
rule cityfirst {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} base {y -1 x 4} 4column{} city{x 5}}
rule cityfirst {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} 3column{} city{x 4}}
rule cityfirst {base{y -1} base {y -1 x 1} base {y -1 x 2} 2column{} city{x 3}}
rule city 2 {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} base {y -1 x 4} base {y -1 x 5} 5column{} city{x 6}}
rule city 2 {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} base {y -1 x 4} 4column{} city{x 5}}
rule city 2 {base{y -1} base {y -1 x 1} base {y -1 x 2} base {y -1 x 3} 3column{} city{x 4}}
rule city 2 {base{y -1} base {y -1 x 1} base {y -1 x 2} 2column{} city{x 3}}
rule city 3 {base{y -1} city{x 1}}
rule city {base{y -1}}
// street piece
rule base{SQUARE{} SQUARE{s 0.52 y -0.5 x -0.25 b 0.4} SQUARE{s 0.52 y -0.5 x 0.25 b 0.4} SQUARE{s 0.08 y 0.15 x -0.5 b 0.8} SQUARE{s 0.08 y 0.15 x -0.42 b 0.8} SQUARE{s 0.08 y 0.15 x -0.16 b 0.8} SQUARE{s 0.08 y 0.15 x -0.08 b 0.8} SQUARE{s 0.08 y 0.15 x 0.18 b 0.8} SQUARE{s 0.08 y 0.15 x 0.26 b 0.8} }
rule 5column 20 {unit{} unit{x 1} unit{x 2} unit{x 3} unitside{x 4} 5column{y 1}}
rule 5column {unittop{} unittop{x 1} unittop{x 2} unittop{x 3} unittopside{x 4}}
rule 5column {unittop{} unittop{x 1} unittop{x 2} unittop{x 3} unittopside{x 4} 5tower{y 0.75 x -0.25}}
rule 5column 2 {unit{} unit{x 1} unit{x 2} unit{x 3} unittopside{x 4} 4column{y 1}}
rule 5column 2 {unittop{} unit{x 1} unit{x 2} unit{x 3} unitside{x 4} 4column{y 1 x 1}}
rule 5column 2 {unittop{} unit{x 1} unit{x 2} unit{x 3} unittopside{x 4} 3column{y 1 x 1}}
rule 4column 15 {unit{} unit{x 1} unit{x 2} unitside{x 3} 4column{y 1}}
rule 4column {unittop{} unittop{x 1} unittop{x 2} unittopside{x 3} }
rule 4column {unittop{} unittop{x 1} unittop{x 2} unittopside{x 3} 4tower{y 0.75 x -0.25}}
rule 4column 2 {unit{} unit{x 1} unit{x 2} unittopside{x 3} 3column{y 1}}
rule 4column 2 {unittop{} unit{x 1} unit{x 2} unitside{x 3} 3column{y 1 x 1}}
rule 4column 2 {unittop{} unit{x 1} unit{x 2} unittopside{x 3} 2column{y 1 x 1}}
rule 3column 10 {unit{} unit{x 1} unitside{x 2} 3column{y 1}}
rule 3column {unittop{} unittop{x 1} unittopside{x 2} }
rule 3column {unittop{} unittop{x 1} unittopside{x 2} 3tower{y 0.75 x -0.25}}
rule 3column 2 {unit{} unit{x 1} unittopside{x 2} 2column{y 1}}
rule 3column 2 {unittop{} unit{x 1} unitside{x 2} 2column{y 1 x 1}}
rule 2column 5 {unit{} unitside{x 1} 2column{y 1}}
rule 2column {unittop{} unittopside{x 1} }
rule 2column {unittop{} unittopside{x 1} 2tower{y 0.75 x -0.25}}
rule unittopside {
SQUARE{x 0.15 y 0.05}
SQUARE{x 0.3 y 0.1}
SQUARE{x 0.3 s 0.97}
unit{}
}
rule unittop {
SQUARE{x 0.15 y 0.05}
SQUARE{x 0.3 y 0.1}
SQUARE{x 0.3 s 0.97}
unit{}
unit{x 1}
}
rule unitside {
SQUARE{x 0.3 y 0.1}
SQUARE{x 0.3 s 0.97}
unit{}
}
rule unit {
SQUARE{b 0.4}
unitwindow{s 0.25 x 0.25 y 0.25}
unitwindow{s 0.25 x -0.25 y 0.25}
unitwindow{s 0.25 x 0.25 y -0.25}
unitwindow{s 0.25 x -0.25 y -0.25}
}
rule towerunittop {
SQUARE{s 0.5 x 0.15 y 0.05}
SQUARE{s 0.5 x 0.3 y 0.1}
towerunit{}
towerunit{x 0.5}
}
rule towerunittopside {
SQUARE{s 0.5 x 0.15 y 0.05}
SQUARE{s 0.5 x 0.3 y 0.1}
towerunit{}
}
rule towerunit{
SQUARE{s 0.5 b 0.4}
unitwindow{s 0.25}
}
rule unitwindow{ SQUARE{b 1.0} }
rule unitwindow{ SQUARE{b -1.0} }
rule 5tower{
towerunittop{x 0.5}
towerunit{x 1.0}
towerunit{x 1.5}
towerunit{x 2.0}
towerunit{x 2.5}
towerunit{x 3.0}
towerunit{x 3.5}
towerunittopside{x 4.0}
towerunittop{x 1.0 y 0.5}
towerunit{x 1.5 y 0.5}
towerunit{x 2.0 y 0.5}
towerunit{x 2.5 y 0.5}
towerunit{x 3.0 y 0.5}
towerunittopside{x 3.5 y 0.5}
towerunittop{x 1.5 y 1.0}
towerunit{x 2.0 y 1.0}
towerunit{x 2.5 y 1.0}
towerunittopside{x 3.0 y 1.0}
towerunittop{x 2.0 y 1.5}
towerunittopside{x 2.5 y 1.5}
}
rule 4tower{
towerunittop{x 0.5}
towerunit{x 1.0}
towerunit{x 1.5}
towerunit{x 2.0}
towerunit{x 2.5}
towerunittopside{x 3.0}
towerunittop{x 1.0 y 0.5}
towerunit{x 1.5 y 0.5}
towerunit{x 2.0 y 0.5}
towerunittopside{x 2.5 y 0.5}
towerunittop{x 1.5 y 1.0}
towerunittopside{x 2.0 y 1.0}
}
rule 3tower{
towerunittop{x 0.5}
towerunit{x 1.0}
towerunit{x 1.5}
towerunittopside{x 2.0}
towerunittop{x 1.0 y 0.5}
towerunittopside{x 1.5 y 0.5}
}
rule 2tower{
towerunittop{x 0.5}
towerunittopside{x 1.0}
}