CST 112
Intro. to Programming
(with Processing/Java)
Final Exam
  1. In the "Animal" class, add a constructor with a different number of arguments than any other constructor.
  2. Add code to the "Animal" class to draw objects with shape = 2 (submarine): ellipse with rectangle on top, and one pair of "arms".
  3. Declare a "submarine" object (Animal with shape=2), using your new constructor Make it move up & down rapidly (dy= +/- 8), left/right slowly (dx= +/- 0.5)
  4. Add code to move and show the "submarine" in each frame.
    Examine the code for the ant object, (which is an instantiation of the Animal class with and shape 6 and 3 pairs of arms). When it reaches the surface, it "dies" (change color to gray) and floats there (dy=0). Then, when it floats off the right edge, a new object is created at the bottom.
  5. Create an array of 5 "bugs" (3 armpairs) that behave the same way as "ant". (See code for ant. Make loops to do the same for each for each bugs[j].
  6. Add wings to bird - flap them up/down every second.
  7. Add a second bird, of a different color.
  8. Activate cat, bird, and sub when clicked. See the code for keyPressed()
  9. Add a loop to scene() to draw blades of green "grass" across the bottom. Make the grass lean in the same direction that the cat is moving (cat.dx).
  10. Add code to display the score, but only when it is not zero..
  11. Add code to detect crashes and change the score. Bird eats bug (+25). Cat catches bird (-100) Zoog catches bird (+50) -- ... add two more "crashes" -- ... and change score when detected.