Author: Ezra Velazquez Date: 9/22/10 Prof: Che-Wei Wang Week: Two Note: User must place the lettered bubbles in their correct spot in order to learn the word's definition / // Color Scheme color c1 = #001F11; color c2 = #204709; color c3 = #0C8558; color c4 = #FFD96A; color c5 = #FF4533; // Center of Bot int centerX = 0; int centerY = 0; /* //Center of Bubbles int x1 = (int) random(100,screen.width-100); int y1 = (int) random(100,screen.height-350); int x2 = (int) random(100,screen.width-100); int y2 = (int) random(100,screen.height-350); int x3 = (int) random(100,screen.width-100); int y3 = (int) random(100,screen.height-300); int x4 = (int) random(100,screen.width-100); int y4 = (int) random(100,screen.height-300); int x5 = (int) random(100,screen.width-100); int y5 = (int) random(100,screen.height-300); //Where the Bubbles Should Go int barX1 = screen.width/2-300; int barY1 = screen.height-210; int barX2 = screen.width/2-140; int barY2 = screen.height-210; int barX3 = screen.width/2+30; int barY3 = screen.height-210; int barX4 = screen.width/2+200; int barY4 = screen.height-210; int barX5 = screen.width/2+360; int barY5 = screen.height-210; / //Center of Bubbles int x1 = (int) random(100,1000-100); int y1 = (int) random(100,1000-350); int x2 = (int) random(100,1000-100); int y2 = (int) random(100,1000-350); int x3 = (int) random(100,1000-100); int y3 = (int) random(100,1000-300); int x4 = (int) random(100,1000-100); int y4 = (int) random(100,1000-300); int x5 = (int) random(100,1000-100); int y5 = (int) random(100,1000-300); //Where the Bubbles Should Go int barX1 = 500-300; int barY1 = 1000-210; int barX2 = 500-140; int barY2 = 1000-210; int barX3 = 500+30; int barY3 = 1000-210; int barX4 = 500+200; int barY4 = 1000-210; int barX5 = 500+360; int barY5 = 1000-210; // Conditionals to check if bubbles are in there // correct spot boolean p1 = false; boolean p2 = false; boolean p3 = false; boolean p4 = false; boolean p5 = false; boolean carry = false; char currentlyCarrying = '.'; void setup() { //size(screen.width, screen.height); size(1000, 1000); centerX = 500; centerY = 500; //centerX = screen.width/2; //centerY = screen.height/2; rectMode(CENTER); ellipseMode(CENTER); smooth(); background(c4); } void draw() { background(c4); //Body & Eyelashes fill(c3); noStroke(); rect(centerX,centerY,100,100); stroke(255); strokeWeight(4); line(centerX-20,centerY-20,centerX-100,centerY-50); line(centerX+20,centerY-20,centerX+100,centerY-50); //Eyes //Closed Sleepy Eyes if (carry == false) { stroke(0); //Left Eye line(centerX-15,centerY-5,centerX-40,centerY-5); //Right Eye line(centerX+15,centerY-5,centerX+40,centerY-5); } //Open Freaked Out Eyes else //if (carry == true) { noStroke(); fill(c2); //Left Eye ellipse(centerX-25,centerY-5,10,10); //Right Eye ellipse(centerX+25,centerY-5,10,10); } stroke(0); //Left Hand line(centerX-50,centerY+25,centerX-100,centerY+75); line(centerX-100,centerY+75,centerX-25,centerY+100); //Right Hand line(centerX+50,centerY+25,centerX+100,centerY+75); line(centerX+100,centerY+75,centerX+25,centerY+100); // Bubbles balls('L',x1,y1,p1,barX1,barY1); balls('O',x2,y2,p2,barX2,barY2); balls('U',x3,y3,p3,barX3,barY3); balls('E',x4,y4,p4,barX4,barY4); balls('A',x5,y5,p5,barX5,barY5); //Holding Bar for bubbles noStroke(); fill(c1); //rect(screen.width/2,screen.height-250,800,50); rect(500,1000-250,800,50); textSize(24); fill(255); /*text('1',screen.width/2-330,screen.height-240); text('2',screen.width/2-170,screen.height-240); text('3',screen.width/2,screen.height-240); text('4',screen.width/2+170,screen.height-240); text('5',screen.width/2+330,screen.height-240);

Source code: week_2

Built with Processing