Cover

8 - Objects

Goals

OOP

Using a Class - Pseudo-code

Using a Class - Code

Steps in Using a Class

  1. Declare an object variable. E.g.
    Car myCar;
  2. Initialize an object. E.g.
    myCar = new Car();
  3. Use an object. E.g.
    myCar.move();

Defining a Class

Class Style

Processing Tab

Constructor Arguments

Exercise

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?