Car
has functions move()
and display()
Car
:
//EXAMPLE: what a program that uses an object looks like Car myCar; void setup() { myCar = new Car(); } void draw() { background(0); myCar.move(); myCar.display(); }
Car myCar;
myCar = new Car();
myCar.move();
Car
for this sketch in a
tab: ClassCar
Car(color c_, float xpos_, float ypos_, float xspeed_) { c = c_; xpos = xpos_; ypos = ypos_; xspeed = xspeed_; }
myCar = new Car(color(255,0,0),0,100,2);
Make a class out of Zoog (or your creature). Create a sketch that has a separate tab for Zoog and one Zoog object. Then make two Zoog objects. What functions can you write that change Zoog's appearance or behavior?