Modify a text file: $/p2.pde
$/p2.pde
//// CST 112 Project #2 / Marcos Quijano //// String author= "Marcos Quijano"; String title= "Rover Class"; float horizon; void setup() { background( 20, 60, 170 ); size(600, 400); fill( 150, 150, 150 ); horizon= height / 2.75; } void draw() { /// Draw grass fill(50, 160, 50); rect(0, horizon, width, height+horizon); /// draw: hero fill(300, 300, 200); rect(380,105, 20,5); rect(430,105, 20,5); rect(405,140, 5,30); rect(420,140, 5,30); fill(0, 255, 0); rect(400,100, 30,50); fill(300, 300, 200); ellipse(415,90,40,40); fill(300, 300, 300); ellipse(410,90, 10,10); ellipse(420,90, 10,10); fill(0, 0, 0); ellipse(410,90, 2,2); ellipse(420,90, 2,2); ellipse(415, 100, 5, 6); /// Draw: house fill( 255, 0, 0 ); rect( 100,100, 100,50 ); rect( 130,50, 15,50); triangle( 100,100, 200,100, 150,60 ); fill( 0, 0, 0); rect( 110, 110, 30, 40 ); /// Draw: Rover fill( 120, 120, 120 ); rect( 200, 170, 50, 30 ); rect( 240, 160, 30, 20 ); rect( 230, 160, 20, 10 ); fill( 300, 300, 300 ); ellipse( 260, 170, 10, 10 ); fill( 0, 0, 0 ); ellipse( 260, 170, 2, 2 ); class Rover { // DATA MEMBERS // float x=60, y=200, xx,yy; // Position & speed float wide=60, high=30; // Default dimensions