// Project 1 // Justin Gonzalez 9/12/14 int score=0 ; float horizon=600; float sunx=100 , suny=100; float jeffx=300 ,jeffy=300; float xerathx=400, xerathy=400; float cassx=200, cassy=200; float bobx=500, boby=500; void setup(){ //setup// size(1300,900); horizon= height/4; suny= horizon/2; jeffx=width/2; jeffy= height/2; xerathx=30; //Xerathy= random(horizon/); } void draw(){ //next frame// scene(); hero(); monster(); scoring(); eat(); } void scene(){ //sky, sun ,etc background(200,200,255); fill(255,255,0); ellipse(sunx,suny,50,50); //sun fill(0,255,0); rectMode(CORNER); rect(0,horizon,width,height*3/4); //grass sunx= sunx+2; score= score+10; //text(sunx, sunx ,suny+40); fill(0); text("Score",1100,100); } void hero(){ //move and draw hero jeffx= jeffx + (mouseX-jeffx) / 5; jeffy= jeffy + (mouseY-jeffy) / 5; //body of jeff fill(255,0,0); rectMode(CENTER); rect(jeffx,jeffy, 50,50); //head of jeff fill(255,127,0); ellipse(jeffx,jeffy-30,40,50); } void monster(){ ///chase Annie xerathx= xerathx+(jeffx-xerathx)/50; xerathy= xerathy+(jeffy-xerathy)/50; //draw Xerath //body of xerath fill(255,100,0); rectMode(CENTER); rect(xerathx,xerathy, 70,70); fill(0); text("Xerath",xerathx-20,xerathy-12); //head of xerath fill(255,127,0); ellipse(xerathx,xerathy-70/2,65,65); fill(255,255,155); ellipse(xerathx,xerathy-70/2,65/2,65/2); fill(0); ellipse(xerathx,xerathy-70/2,65/4,65/4); //cass ///chase Annie cassx= cassx+(jeffx+70-cassx)/60; cassy= cassy+(jeffy+70-cassy)/60; //draw cass //body of cass fill(255,0,255); rectMode(CENTER); rect(cassx,cassy, 70,70); fill(0); text("Cass",cassx-20,cassy-12); //head of cass fill(255,127,0); ellipse(cassx,cassy-70/2,65,65); fill(255,0,0); ellipse(cassx,cassy-70/2,65/2,65/2); fill(0); ellipse(cassx,cassy-70/2,65/4,65/4); //bob ///chase Annie bobx= bobx+(jeffx-70-bobx)/40; boby= boby+(jeffy-70-boby)/40; //draw bob //body of bob fill(255,200,0); rectMode(CENTER); rect(bobx,boby, 70,70); fill(0); text("Bob",bobx-20,boby-12); //head of bob fill(255,127,0); ellipse(bobx,boby-70/2,65,65); } void scoring(){ //score=0; //if xerathx