Project 05: Wallpaper

sketchDownload
var b; //x position for badfruit
var c; //y position for badfruit

function setup() {
    createCanvas(600, 600);
    background(180, 199, 137);
}


function goodfruit(x,y) {
    stroke(241, 240, 217);
    bezier(x,y+5,x-35,y-25,x-15,y+45,x,y+25); //leftside
    bezier(x,y+5,x+35,y-25,x+15,y+45,x,y+25); //rightside
}


function vine(x) {

    //vines
    noStroke();
    fill(241, 240, 217);
    rect(x-12,0,24,600);
    triangle(x,505,x,540,x+60,460); //bottomright
    triangle(x,480,x,445,x-60,400); //bottomleft
    triangle(x,360,x,325,x+60,280); //middleright
    triangle(x,300,x,265,x-60,220); //middleleft
    triangle(x,180,x,145,x+60,100); //topleft
    triangle(x,120,x,85,x-60,40); //topright

    //branches
    triangle(x+42,480,x+38,545,x+46,545); //bottomright
    goodfruit(x+42,535);
    triangle(x-42,420,x-38,485,x-46,485); //bottomleft
    goodfruit(x-42,475);

    triangle(x+42,300,x+38,365,x+46,365); //middleright
    goodfruit(x+42,355);
    triangle(x-42,240,x-38,305,x-46,305); //middleleft
    goodfruit(x-42, 295);

    triangle(x+42,120,x+38,185,x+46,185); //topright
    goodfruit(x+42,175);
    triangle(x-42,60,x-38,125,x-46,125); //topleft
    goodfruit(x-42, 115);

}

function badfruit(b,c) {
    stroke(96, 93, 42);
    fill(96, 93, 42);
    triangle(b,c-10,b-2,c+4,b+2,c+4); //stem
    bezier(b,c+5,b-35,c-25,b-15,c+45,b,c+25); //leftside
    bezier(b,c+5,b+35,c-25,b+15,c+45,b,c+25); //rightside
}


function draw() {

    vine(300);
    vine(480);
    vine(120);

    for (var b=35; b<=600; b+=176.5) { //increase from first to fourth row
       for(var c=25; c<=600; c+=176.5)  { //count from first to fourth column
        badfruit(b,c);
    }
}


//bible verse
fill(241, 240, 217);
    noStroke();
    textSize(12);
    textAlign(CENTER);
    text("JOHN 15:5",560,590);

}

Leave a Reply