//// CST 112 Project #2 / Marcos Quijano //// String author= "Marcos Quijano"; String title= "Rover Class"; float horizon; Dog rover; Hero mark; void setup() { size(600, 400); fill( 150, 150, 150 ); horizon= height / 2.75; // rover = new Dog(); mark = new Hero(); } void draw() { background( 20, 60, 170 ); // Sky /// Draw grass class Dog { // DATA MEMBERS // float x=200, y=170, xx=3,yy=2; // Position & speed float wide=60, high=30; // Default dimensions //////// METHODS //////// void show() { /// Draw: Rover fill( 120, 120, 120 ); rect( x, y, 50, 30 ); rect( x+40, y-10, 30, 20 ); rect( x+30, y-10, 20, 10 ); fill( 200, 300, 300 ); ellipse( x+60, y, 10, 10 ); fill( 0, 0, 0 ); ellipse( x+60, y, 2, 2 ); } void move() { x = x + xx; y = y + yy; if (x > width) xx = -xx; // Bounce. if (x < 0) xx = -xx; if (y > height) yy = -yy; if (y < horizon/2) yy = -yy; } }// class Dog // class Hero { float x=380, y=105, xx=3,yy=2; // Position & speed float wide=60, high=30; // Default dimensions //////// METHODS //////// void show() { // +++++ ADD CODE HERE !!!! } void move() { x = x + xx; y = y + yy; if (x > width) xx = -xx; // Bounce. if (x < 0) xx = -xx; if (y > height) yy = -yy; if (y < horizon/2) yy = -yy; } }//class Hero //