PROJECT 05- WALLPAPER

sketch
//junelee
//section c
//15-104
//junelee@andrew.cmu.edu
//project-05



function setup() {
    createCanvas(350,500);
    background(0,51,0);
}

function dangoo(x,y) {

	push();
	translate(x,y);

	strokeWeight(0.3);

	fill(102,0,204); //purple
	circle(35,31.5,10); //4
	fill(255);
	circle(35,31.5,6);

	fill(255); //stripe-white
	circle(45,31.5,10); //14

	fill(0,51,204); //blue
	circle(55,31.5,10); //2
	fill(255);
	circle(55,31.5,6);

	fill(255); //stripe-white
	circle(65,31.5,10); //10
	circle(75,31.5,10); //9
	circle(40,40,10); //13

	fill(128,0,0); //red
	circle(50,40,10); //7
	fill(255);
	circle(50,40,6);

	fill(0,102,0); //green
	circle(60,40,10); //6
	fill(255);
	circle(60,40,6);

	fill(255); //stripe-white
	circle(70,40,10); //11

	fill(255,102,0); //orange
	circle(45,48.5,10); //5
	fill(255);
	circle(45,48.5,6);

	fill(0); //black
	circle(55,48.5,10); //8
	fill(255);
	circle(55,48.5,6);


	fill(200,0,0); //red
	circle(65,48.5,10); //3
	fill(255);
	circle(65,48.5,6);
	
	fill(255);
	circle(50,57,10); //15
	circle(60,57,10); //12

	fill(255,204,0); //yellow
	circle(55,65.5,10); //1
	fill(255);
	circle(55,65.5,6);


	textSize(5);
	fill(0);
	text('4',33.5,33);
	text('14',42,33);
	text('2',53.5,33);
	text('10',62,33);
	text('9',73,33);

	text('13',37,42);
	text('7',48.5,42);
	text('6',58.5,42);
	text('11',67.5,42);

	text('5',43.5,50.5);
	text('8',53.5,50.5);
	text('3',63.5,50.5);

	text('15',47,59);
	text('12',57,59);

	text('1',53.5,67.5);

	pop();
	}

function draw() {

	for (var x=1; x<5; x+=1) {
		for (var y=1; y<7; y+=1) {
			dangoo(75*x-65,75*y-55);
		}
	}

}

For the wallpaper, I wanted to make the setup of the billiard balls that are still in their placement. I then repeated this on the x and y axis by defining function dangoo().

Leave a Reply