Modify a text file: $/z2.pde
$/z2.pde
String title= "Project #2"; String author= "Your Name"; Hero Gucci; Dog Dior; Monster Fendi; Star sol; House home; int ntrees=3; Tree[] trees = new Tree[ntrees]; boolean day = true; float horizon; void setup() { size( 800, 600 ); horizon= height / 4; // Instatiation of objects. // Gucci = new Hero(); Dior = new Dog(); Fendi = new Monster(); sol = new Star(); for (int n=0; n
width) { sunset(); } // Night & Day. x = x + dx; y = y + dy; } void sunset() { day = ! day; // Switch nite/day x = 0; // Reset to left } } class Fendi { // MEMBER DATA. // float x=0, y=50, dx=1, dy=0; // Position & speed. // add rest here void chase( float x2, float y2 ) { if ( day ) { return; } // No day chasing. // Slowly chase (x2,y2) dx = (x2-x) / 120; dy = (y2-y) / 120; move(); } void move() { x = x + dx; y = y + dy; } // add rest here void Hero(){ float x=0, y=50, dx=1, dy=0; // Position and speed float w=30, h=30; // Width & Height color c = color(255,255,0); // void show(){ } // METHODS // } }