Modify a text file: $/unofficial_p1.pde
$/unofficial_p1.pde
//Project 1 //Mark Pepra //Global declarations float xMark, yMark, xMspeed, yMspeed; float xPup, yPup, xPspeed, yPspeed; float xSun, ySun, xHouse, yHouse; float horizon; float x, y; //setup void setup() { size (700, 600); horizon = 350; smooth(); xSun=width/15; ySun=100; } void reset() { xMark= 100+width/4; yMark= horizon+70; xMspeed= random(2,5); yMspeed= random(1,3); xPup= width/4; yPup= horizon+50; xPspeed= random(4,6); yPspeed= random(3,5); } //draw sky sun person grass house dog void draw() { //scene sky sun grass house person dog //bluesky background(173,199,232); //green grass fill(10,144,47); rect(0,horizon,700,600); //sun noStroke(); fill(242,242,56); ellipse(xSun, ySun,60,60); //tree stroke(0,0,0); fill(200,50,50); rect(500,255,30,105); fill(200,255,100); ellipse(515,230,70,70); //houseeee fill(227, 158, 167); rect(50, 220, 180, 180); fill(0, 0, 0); triangle(47, 220, 233, 220, 140, 130); //windows fill(255); rect(60, 250, 50, 50); rect(170, 250, 50, 50); //door fill(193, 70, 209); rect(110, 330, 50, 70); ellipse(135, 330, 50, 50); //knob fill(255, 255, 0); ellipse(155, 355, 10, 10); //person fill(11,57,111); rect(400,300,50,150); //head fill(83,6,147); ellipse(425,300,50,50); //eyes fill(255); ellipse(410,300,9,9); ellipse(435,300,9,9); //doggggggg Pup //body fill(250,120,0); rect(280,300,100,50); //head rect(260,280,60,40); //eyes fill (255); ellipse(270,290,9,9); } void action () { //Action if (xSun > width) { xSun=0; } xSun=xSun+2; // Move the person Mark if (xMark > width-30) { xMspeed = -xMspeed; } if (xMark < 20) { xMspeed = -xMspeed; } if (yMark > height-30) { yMspeed = -yMspeed; } if (yMark < horizon) { yMspeed = -yMspeed; } xMark= xMark + xMspeed; }