Objectives:
Instead
of writing methods for the world, we are going to write methods that define
new actions for the object (in this case the skater) alone. We are
then going to define a new class, CleverSkater, who will know how to skate,
and spin, etc. This class then can be used by many different worlds.
Follow
the instructions on pp110-116 to write the class methods skate and spin for
the skater.
Follow
the instructions on p117-118 on how we can save this as a new class, CleverSkater.
| Assignment: Create an even better skater class as described on p133 #9. Be sure to test out your new class within a new world. |
| Assignment: Create a turning combination lock as described on p133 #10. Save this new class. |
| Assignment: Create a new class TrainedNinja as described on p134 #12. Test out your class with a world with two trainedNinjas practicing. |