Modify a text file: $/x212Gao.pde
$/x212Gao.pde
// x212Gao String title= "Project 1"; String author= "L. Gao"; float sunX=50, sunY=100; // Sun float larryX, larryY, larryXspeed=3, larryYspeed=2; float horizon; void setup() { size(500, 500); horizon= height/4; } void draw() { scene(); action(); messages(); } void scene() { background( 150, 220, 250 ); // Grass fill( 50,200,50 ); rect( 0,horizon, width,height-horizon ); fill( 255,0,0 ); rect( 50, horizon-60, 80, 60 ); // Yellow sun fill( 255, 255, 0 ); ellipse( sunX, sunY, 40, 40 ); } void messages () { fill(204, 102, 0); //orange text textSize(24); text( title, width/3, 30 ); textSize(12); text( author, 20, height-20 ); } // sun void action() { fill(300, 300, 300); sunX= sunX + 1; if (sunX > width) { sunX=0; sunY= random( 20, 120 ); } // Larry: show, move ellipse( larryX, larryY, 30, 50 ); larryX= larryX + larryXspeed; larryY= larryY + larryYspeed; } void mousePressed() { larryX= mouseX; larryY= mouseY; larryXspeed= random( -5, +5 ); larryYspeed= random( -3, +3 ); }