Project 5- Wallpaper

sketch
var col1;
var row1;
var col2;
var row2;
var col3;
var row3;
function setup() {
    createCanvas(600, 400);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    background(88,24,69);
    for (col2 = 50; col2 <=600; col2 += 100) {
        for(row2 = -50; row2 <= 400; row2 += 100) {
            stroke(218,247,166);
            noFill();
            ellipse(col2, row2 + 50, 100, 100);
        }
        noLoop();
    }
    for(col1 = 50; col1 <= 600; col1 += 200) {
        for(row1 = 50; row1 <=600; row1 += 200) {
            flower(col1,row1);
            print(row1);
        }
        print(col1);
    }
    noLoop();
    for(col3 = 150; col3 <= 600; col3 += 200) {
        for(row3 = 150; row3 <= 600; row3 += 200) {
            flower(col3, row3);
        }
    }
}

function flower(x,y) {
    fill(199,0,57);
    stroke(255,131,105);
    push();
    translate(x,y);
    ellipse(25,0,50,30);
    rotate(PI/3);
    ellipse(25,0,50,30);
    rotate(PI/3);
    ellipse(25,0,50,30);
    rotate(PI/3);
    ellipse(25,0,50,30);
    rotate(PI/3);
    ellipse(25,0,50,30);
    rotate(PI/3);
    ellipse(25,0,50,30);
    fill(199,0,57);
    stroke(199,0,57);
    ellipse(0,0,10,10);
    pop();
}

Leave a Reply