// A house with garden, on a sunny day size(500, 500); background(135, 206, 235); // position and size int groundY = 400; int houseWidth = 240; int houseHeight = 180; int houseX = 170; int houseY = groundY - houseHeight; int roofHeight = 100; int roofOverhang = 25; int windowSize = 50; int doorWidth = 50; int doorHeight = 90; int sunX = 90; int sunY = 90; int sunSize = 90; int windowX = houseX + 30; float outline = 5; color currentColour = color(90, 170, 70); // green for grass // Grass noStroke(); fill(currentColour); rect(0, groundY, width, height - groundY); // Sun rays stroke(255, 170, 0); strokeWeight(outline); line(sunX - 85, sunY, sunX + 85, sunY); line(sunX, sunY - 85, sunX, sunY + 85); line(sunX - 60, sunY - 60, sunX + 60, sunY + 60); line(sunX - 60, sunY + 60, sunX + 60, sunY - 60); // Sun noStroke(); currentColour = color(255, 220, 0); fill(currentColour); ellipse(sunX, sunY, sunSize, sunSize); // House walls outline = outline - 2; strokeWeight(outline); stroke(0); currentColour = color(255, 255, 255); fill(currentColour); rect(houseX, houseY, houseWidth, houseHeight); // Roof outline = outline + 1; strokeWeight(outline); currentColour = color(190, 50, 30); fill(currentColour); triangle(houseX - roofOverhang, houseY, houseX + houseWidth + roofOverhang, houseY, houseX + houseWidth / 2, houseY - roofHeight); // Door outline = outline - 1; strokeWeight(outline); currentColour = color(90, 70, 35); fill(currentColour); rect(houseX + (houseWidth - doorWidth) / 2, groundY - doorHeight, doorWidth, doorHeight); // Door knob currentColour = color(255, 215, 80); fill(currentColour); ellipse(houseX + (houseWidth + doorWidth) / 2 - 10, groundY - doorHeight / 2, 8, 8); // Left window currentColour = color(170, 225, 250); fill(currentColour); rect(windowX, houseY + 40, windowSize, windowSize); // Right window windowX = windowX + 130; rect(windowX, houseY + 40, windowSize, windowSize); save("assignment1.png");