Modify a text file: $/p1_228_.pde
$/p1_228_.pde
//Singh // //project 1 // float sunX, sunY; float fence; float sueX, sueY, sueXspeed, sueYspeed; float samX, samY, samXspeed, samYspeed, samFast=1; float samW=80, samH=40; void setup() { size(500,500); frameRate(30); sunX=50; sunY=50; sueX=40; sueY=40; } void reset() { sueXspeed= random( -3,+3 ); sueYspeed= random( -5,+5); } void draw() { action(); //scene background(25,60,225); //sun fill(225,225,0); ellipse(sunX,sunY,30,40); stroke(225,220,0); if (sunX > width){ sunX=0; } sunX= sunX+1; //grass fill(0,230,40); rect(0,250,500,250); //house stroke(0); fill(200); rect(80,130,140,70); rect(90,200,120,60); stroke(0); fill(260,0,50); triangle(230,130,150,70,70,130); //roof stroke(255); fill(50); rect(135,140,30,120); //door fill(125,150,160); rect(110,150,10,30); //window fill(125,150,160); rect(190,150,10,30); //window //fence fill(225); fence=0; while (fence
300){ sueX=0; } sueX= sueX+2; sunX= sunX+1; //dog=sam fill(255); rect(250,320,70,30,30); //body rect(225,300,50,20); //head fill(0); ellipse(225,300,10,10); //nose //tree// fill(150,70,20); ellipse(400,200,20,110); fill(50,225,80); ellipse(400,150,110,100); } void action() { sueX = sueX + sueXspeed; sueY = sueY + sueYspeed; } void mousePressed(){ sueX= mouseX; sueY= mouseY; reset(); }