////sept 18 2013 ////project one; Michael Hotetz void setup(){ size(600,400); } void draw(){ scene(); hero(); texts(); } void scene(){ background (0,255,0); ////sets sky size and color to blue noStroke(); fill(200,220,250); rectMode(CORNER); rect (0,0,600,150); ////sets sun size and color to yellow moves across screen ellipseMode(CENTER); noStroke(); fill(255,230,0); ellipse((frameCount/2)% width,50,100,100); ////sets sun rays, thickness of rays and color to yellow ////lines go counter clockwise starting closest to top of screen strokeWeight(3); stroke(255,230,0); line((frameCount/2-90)% width,20,(frameCount/2-50)% width,30); line((frameCount/2-90)% width,100,(frameCount/2-50)% width,75); line((frameCount/2-25)% width,100,(frameCount/2-40)% width,130); line((frameCount/2+30)% width,100,(frameCount/2+50)% width,130); line((frameCount/2+50)% width,70,(frameCount/2+90)% width,90); ////sets clouds, 6 ellipses from left to right noStroke(); fill(255); ellipse(50,50,50,50); ellipse(80,50,60,60); ellipse(110,50,50,50); ellipse(225,75,50,50); ellipse(255,75,60,60); ellipse(285,75,50,50); ////sets chiminey and color to red stroke(0); strokeWeight(2); fill(255,0,0); rect(55,200,15,30); ////sets roof of house and roof color to gray fill(200,200,200); stroke(0); triangle(30,250,110,180,190,250); ////sets house and house color to red fill(255,0,0); rect(40,250,140,100); ////sets door and doorknob, sets colors to black and gold fill(160,82,45); rect(97.5,300,25,50); stroke(255,230,0); strokeWeight(3); point(100,320); ////sets left window and window panes stroke(0); strokeWeight(2); fill(200,250,250); rect(61.25,275,25,25); line(73.75,275,73.75,300); line(61.25,287.5,86.25,287.5); ////sets right window and window panes rect(137.5,275,25,25); line(137.5,287.5,162.5,287.5); line(150,275,150,300); } void hero(){ ////lays hero down when keys are pressed noCursor(); if (keyPressed==true){ bodyandheadandlegs1(); armsandmouth1(); }else{ bodyandheadandlegs(); armsandmouth(); } } void bodyandheadandlegs(){ ellipseMode(RADIUS); fill(131,74,17); ellipse(mouseX,mouseY,20,30); ////hero head and eyes fill(250,188,126); ellipse(mouseX,mouseY-45,15,15); fill(255); ellipse(mouseX+7,mouseY-50,5,5); ellipse(mouseX-7,mouseY-50,5,5); fill(36,30,250); ellipse(mouseX+7,mouseY-50,2,2); ellipse(mouseX-7,mouseY-50,2,2); line(mouseX-10,mouseY+30,mouseX-10,mouseY+40); line(mouseX+10,mouseY+30,mouseX+10,mouseY+40); } void bodyandheadandlegs1(){ //// body head and legs for laying position ellipseMode(RADIUS); fill(131,74,17); ellipse(mouseX,mouseY,30,20); fill(250,188,126); ellipse(mouseX-45,mouseY,15,15); fill(255); ellipse(mouseX-50,mouseY+7,5,5); ellipse(mouseX-50,mouseY-7,5,5); fill(36,30,250); ellipse(mouseX-50,mouseY+7,2,2); ellipse(mouseX-50,mouseY-7,2,2); line(mouseX+30,mouseY-10,mouseX+40,mouseY-10); line(mouseX+30,mouseY+10,mouseX+40,mouseY+10); } ////heros arms and mouth, both move when mouse is pressed void armsandmouth(){ fill(245,2,47); if (mousePressed){ ellipse(mouseX,mouseY-40,5,5); line(mouseX-20,mouseY-10,mouseX-30,mouseY-40); line(mouseX+20,mouseY-10,mouseX+30,mouseY-40); }else{ ellipse(mouseX,mouseY-40,5,2); line(mouseX-20,mouseY-10,mouseX-30,mouseY); line(mouseX+20,mouseY-10,mouseX+30,mouseY); } } void armsandmouth1(){ ////laying down position for arms and mouth fill(245,2,47); if (mousePressed==true){ ellipse(mouseX-40,mouseY,5,5); line(mouseX-10,mouseY-20,mouseX-40,mouseY-30); line(mouseX-10,mouseY+20,mouseX-40,mouseY+30); }else{ ellipse(mouseX-40,mouseY,2,5); line(mouseX-10,mouseY-20,mouseX,mouseY-30); line(mouseX-10,mouseY+20,mouseX,mouseY+30); } } void texts(){ fill(27,8,255); text("Michael Hotetz",50,375); fill(255,206,8); text("Progy",mouseX-15,mouseY); fill(255,8,28); text("Project 1",10,15); }