/// Grace Hernandez Project #1 /// //Global Declrations/// float thotX, thotY; //Location of thotiana float sunX, sunY; // Location of sun float sunQX = 4, sunQY; float horizon; //Horizon float beckyX, beckyY; //Location of becky void setup() { ///Setup: Window /// size( 500, 500); smooth(); frameRate( 50 ); thotX = width*4/5; thotY= height*3.5/5; sunX= width*5/6; sunY= height/4; horizon= height/3; beckyX= pmouseX; beckyY= pmouseY; } void draw() { /// Frame ///// scene(); thot(); becky(); } void scene() { ///Grass, sky, sun////////// sunX= sunX + sunQX; sunX= sunX % width; sunY= horizon- 100*sin( PI * sunX/width); ///rises and falls// horizon= height/3; background( 50, 225, 255 ); ///blue sky/// fill( 255, 250, 2 ); ////yellow sun//// ellipseMode( CORNER ); //nostroke(); ellipse( sunX, sunY, 60, 60 ); fill( 10, 255, 80 ); ///grass/// noStroke(); rectMode(CORNER); rect(0, horizon, width, height ); fill ( 255 );///house/// rectMode( CORNER ); stroke( 0 ); fill( 200, 50, 50 ); rect( 100, horizon, 100, 80 ); fill( 255, 0, 200 ); triangle( 100, horizon, 150, horizon-70, 200, horizon );//roof/ } void becky() { ///Becky is the hero/// beckyX= mouseX; beckyY= mouseY; rectMode( CENTER ); fill( 150, 20, 100 ); ////beckys body/// rect( mouseX, mouseY, 25, 40); ellipseMode( CENTER ); ///beckys head///// fill( 150, 20, 100 ); ellipse( mouseX, mouseY-40, 25, 25 ); } void thot() { thotX = thotX + ( beckyX - thotX ) /20; thotY = thotY + ( beckyY - thotY ) /20; thotY = thotY < horizon-20 ? horizon + 40 : thotY; fill( 0, 100, 150 ); ///thots body/// stroke( 100, 200, 200 ); strokeWeight( 5 ); ellipseMode( CENTER ); ellipse( thotX, thotY, 80, 80 ); }