Modify a text file: $/z2.pde
$/z2.pde
//Project 2 //Farah Rashid String title = "Project #2"; String owner = "Farah Rashid"; //Global declarations int frames = 30; float sunX= 0; float sunY= 50; float horizon; float tree1, tree2, tree3, tree4; float monsterX, monsterY; float heroX, heroY; float heroXspeed, heroYspeed; float dogX, dogY; float dogXspeed, dogYspeed; float house; float houseX, houseY; float gx, gy; //set the size of the output window void setup() { size( 800,700); smooth(); frameRate(frames); horizon = height/2; reset(); } void reset() { heroX = width/1.5; heroY = height/1.5; //random speed heroXspeed = random(2,5); heroYspeed = random(-2,+2); } //draw sky, sun, house, hero. void draw() { scene(); messages(); action(); } void scene() { //sky background (#83F1FA); //BLUE stroke(1); fill(113,237,87); //GREEN rect( -2, 20+horizon, 810,700); //sun noStroke(); fill(254,255,75); //YELLOW ellipse( sunX+90, sunY+10, 100,100); //house stroke(0); fill(150,30,20); //Brown house rect(houseX+110, houseY+170, 250,200); //door fill(10); //BLACK rect( 160,250,100,120); //doorknob fill(255); //WHITE ellipse(190,315,25,25); //trees //tree1 fill(#E89E3D); //BROWN rect(600,350,30,280); fill(#1F860B); //GREEN ellipse(610,355,150,150); //tree2 fill(#A5B2AB); //GREY rect( 390, 450, 30,230); fill(#FCC673); //PEACH ellipse( 400,430, 150,150); } void messages() { fill(10); textSize(20); text( "Farah Rashid/ p2.pde", 10, height-5); fill(10); textSize(20); text("4 trees", 700,height-500); } void action() { if (sunX > width) { sunX = 0;} sunX = sunX+5; }