HW 3, due Wed, Feb 18
The goal of this homework is to use classes and arrays to compose a sketch with multiple dynamic objects doing their own things. Your sketch should have the following features.
- [30 pts] There is at least one class for objects that react to user input (mouse or key). The class should provide an appropriate set of fields, a constructor to initialize them, and methods to display an object and update it based on the user input (among other things you find necessary).
- [30 pts] There is at least one class for objects that are driven by a physical model (e.g., gravity/friction or springs). The class should provide an appropriate set of fields, a constructor to initialize them, and methods to display an object and update it based on the physical model (among other things you find necessary).
- [30 pts] There is at least one uses of an array and loops to handle a set of similar objects. The sketch should be careful to respect the size of the array, either stopping when all objects are used up, or reusing/recycling them.
- [10 pts] The design of the sketch is described in a separate document (plain text / MS Word / pdf). The design document should briefly discuss the pieces of the sketch, what each does and how, and how they are all integrated. This can be informal and short; the goal is to adopt the approach of the raindrop catcher case study to consider how a complex sketch is decomposed into bite-sized pieces.
Provide at the top of the sketch a short statement of instructions on what the sketch is doing and how to interact with it.
The notes and text provide examples of these various techniques (e.g., the raindrop catcher would satisfy the requirements), but you should develop a coherent sketch of your own design, and not just throw the examples together. That is, your sketch will be graded on how well you have demonstrated your understanding of the techniques. Of course, your class based on a physical model will look much like all the examples we've covered, so the goal is to demonstrate that you have integrated and applied the key ideas (extending as necessary) in a setting of your design.
Use comments and reasonable and consistent indentation and whitespace to make the source clear and comprehensible for another human reader (i.e., both you and your grader). Your sketch will be graded on its understandability, in addition to correctness.
As always, turn in the zipfile on Blackboard, as HW 3 in the Assignments section. In the field where you can type in some information, please tell me roughly how long this assignment took, and if there were any particular difficulties.