Skip to content

Instantly share code, notes, and snippets.

@elizasj
Created February 12, 2016 11:10
Show Gist options
  • Save elizasj/b0f11dc1776ef0972a0a to your computer and use it in GitHub Desktop.
Save elizasj/b0f11dc1776ef0972a0a to your computer and use it in GitHub Desktop.
function setup() {
//set canvas size
createCanvas(1024, 768);
//set background color
background(206, 207, 193);
}
function draw() {
//top rectangle
noStroke();
fill(105, 156, 157);
rect(0, 0, width, 100);
//big triangles plot placement
for(var x = 0; x <= width; x += width/2) {
for(var y = 0; y <= height; y += height) {
noStroke();
fill(179,175, 149);
triangle(x, height, x, 0, x+50, height);
}
}
//plot placement
for(var x = 146; x <= width - 146; x += 146) {
for(var y = 153; y <= height - 153; y += 153) {
// draw the roof
fill(72,143,130);
noStroke();
triangle(x-25,y+15,x,y-15,x+25,y+15);
// draw the base
fill(231, 221, 204);
rect(x-15, y+15, 30, 55);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment