Project 5 – Wallpaper

For this project, I was feeling the spooky, Halloween theme so I decided to make some pumpkins. 🎃

sketchDownload
var s = 20;

function setup() {
    createCanvas(600, 600);
    background(255, 174, 0);
}

function draw() {
    background(255, 174, 0);
    for (var row = 1; row < 15; row += 2){
        for (var col = 1; col < 20; col += 3){
            blackCircle(row * 40, col * 40);

        }
    }

    for (var row = 1; row < 8; row += 2){
        for (var col = 1; col < 8; col += 2){
            pumpkin(row * 70, col * 70);

        }
    }
}

//pumpkin
function pumpkin(x, y){
    push();
    translate(x,y);
    noStroke();
    fill(54, 102, 51);
    rect(10, -30, 15, 20);
    fill(255, 85, 0);
    ellipse(20, 20, 100, 80);
    fill(0);
    triangle(0, 10, 5, 0, 10, 10);
    triangle(30, 10, 35, 0, 40, 10);
    arc(20, 20, 70, 60, 0, PI);
    fill(255, 85, 0);
    rect(20, 20, 10, 10);
    pop();
}


//blackcircle
function blackCircle(x, y){
    push();
    translate(x, y);
    noStroke();
    fill(237, 230, 9);
    circle(0, 0, 30);
    fill(0);
    circle(0, 0, 10);
    pop();
}

Leave a Reply