createCanvas(windowWidth, windowHeight);
function drawBlock(x, y, a, b, h, colour) {
let bottomFrontLeft, bottomFrontRight, bottomBackLeft, bottomBackRight;
bottomFrontLeft = createVector(x + bx,
bottomFrontRight = createVector(
bottomBackLeft = createVector(
bottomBackRight = createVector(
bottomFrontLeft = createVector(
bottomFrontRight = createVector(
bottomBackLeft = createVector(
bottomBackRight = createVector(
bottomFrontLeft = createVector(
bottomFrontRight = createVector(
bottomBackLeft = createVector(
bottomBackRight = createVector(
const topFrontLeft = createVector(
const topFrontRight = createVector(
const topBackRight = createVector(
const topBackLeft = createVector(
fill(lerpColor(color(colour), color("#050505"), 0));
topFrontLeft.x, topFrontLeft.y,
topFrontRight.x, topFrontRight.y,
topBackRight.x, topBackRight.y,
topBackLeft.x, topBackLeft.y
fill(lerpColor(color(colour), color("#050505"), 0.25));
topFrontLeft.x, topFrontLeft.y,
topFrontRight.x, topFrontRight.y,
bottomFrontRight.x, bottomFrontRight.y,
bottomFrontLeft.x, bottomFrontLeft.y,
fill(lerpColor(color(colour), color("#050505"), 0.5));
topFrontRight.x, topFrontRight.y,
bottomFrontRight.x, bottomFrontRight.y,
bottomBackRight.x, bottomBackRight.y,
topBackRight.x, topBackRight.y
top: [topBackLeft, topBackRight, topFrontRight, topFrontLeft],
bottom: [bottomBackLeft, bottomBackRight, bottomFrontRight, bottomFrontLeft],
function drawDoor(bottom, a, b, h) {
const v1 = bottom[1].copy();
const v2 = bottom[2].copy();
const v3 = bottom[3].copy();
const colour = "#3587A4cc";
const doorPos = v3.lerp(v2, 0.4);
drawBlock(doorPos.x, doorPos.y, a * 0.2, 0.1, doorH, "#05050577")
let windowPos = v2.lerp(v1, 0.4);
let windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
const doorPos = v2.copy().lerp(v1, 0.4);
drawBlock(doorPos.x, doorPos.y, 0.1, b * 0.2 * 1.2, doorH, "#05050577")
let windowPos = v3.lerp(v2, 0.4);
let windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
function drawWindows(bottom, a, b, h) {
const v1 = bottom[1].copy();
const v2 = bottom[2].copy();
const v3 = bottom[3].copy();
const colour = "#3587A4cc";
let windowPos = v3.lerp(v2, 0.1);
let windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
windowPos = v3.lerp(v2, 0.7);
windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, a * 0.2, 0.1, windowH, colour)
windowPos = v2.lerp(v1, 0.1);
windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
windowPos = v2.lerp(v1, 0.7);
windowY = windowPos.y - h * 0.3;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
windowY = windowPos.y - h * 0.6;
drawBlock(windowPos.x, windowY, 0.1, a * 0.2, windowH, colour)
let a = min(width, height) * 0.1;
let hMin = min(width, height) * 0.05;
let hMax = min(width, height) * 0.1;
for (let y = -100; y <= height + b; y += a * sin(30) * 2) {
for (let x = -100; x <= width + a; x += a * cos(30) * 2) {
const h = random(hMin, hMax);
} = drawBlock(x, y, a, b * 1.2, h, random(palette) + "cc");
drawWindows(bottom, a, b, h);
drawDoor(bottom, a, b, h);
drawBlock(x + a * cos(30) * 0.25, y + a * sin(30) * 0.25, a * 0.5, b * 2, 2, "#272727");
drawBlock(x + a * cos(30) * 0.4, y + a * sin(30) * 0.4, a * 0.05, b * 0.5, 0.01, "#fffbe6");
drawBlock(x + a * cos(30) * 1.4, y + a * sin(30) * -0.6, a * 0.07, b * 0.5, 0.01, "#fffbe6");
drawBlock(x + a * cos(30) * 0.5, y + a * sin(30) * -0.25, a * 2, b * 0.5, 2, "#272727");
drawBlock(x + a * cos(30) * 1.24, y + a * sin(30) * -0.1, a * 0.5, b * 0.05, 0.01, "#fffbe6");
drawBlock(x + a * cos(30) * 2.24, y + a * sin(30) * 0.9, a * 0.5, b * 0.05, 0.01, "#fffbe6");
function mousePressed() {