UW Home     CSE Home   Announcements    Message Board    Contact Info 

 
 
 

CSE143 Autumn 2004 Project #1 Part C

Dinosaurs: Handling User Events

Due: Wednesday, October 27, at 9:00 pm. No late assignments will be accepted.

This is the last part of a project to create a dinosaur safari simulation. For this part you will take your code from part B and add code to handle keyboard, mouse, or other events to control something in the simulation. This should include using the mouse or keyboard to control one or more of the things in the simulation (probably taking over control from one of the Dinosaur objects). In addition, you can add menus or dialogs or other event-driven user interface components to alter parameters or characteristics of the simulation .

You should continue work with your assigned partner on this project using the pair programming style discussed in class. You and your partner will turn in a single set of files under the same name you used for parts A and B. After this final part of the project is done, each of you will individually produce a written report. (Details about that will be supplied separately.)

Grading: You and your partner will receive the same scores on the programming parts of the project. Programming projects will be evaluated both for how well the code works and how well it is written, each on a scale of 0 to 4. Be sure to include appropriate JavaDoc and other comments in your code, use meaningful names, indent sensibly, and so forth.

Overview

For the final part of the project, add event-driven user control to your dinosaur simulation. The exact form of the user interface is up to you, however, it must allow the user to control at least one dinosaur or other object using the keyboard or mouse. Include at least two user events for the simulation to respond to. They must be nontrivially different from the events in the BallSim code. Some possibilities:

  • Display a pallet with several buttons to change the speed or direction of some or all dinosaurs slightly each time the appropriate button is clicked.
  • Control the direction of a dinosaur using the left and right arrow keys and use the up and down arrow keys to ascend or descend.
  • Use the mouse to drag a dinosaur around.

How you choose to control multiple dinosaur and other objects on the screen, if you want to do this, is up to you. Your could have one controller per dinosaur (say, a pallet of control buttons per dinosaur), or you could select an dinosaur with the mouse and have the controls apply to that dinosaur until another one is selected. But if you want to keep things simple, you could just control one dinosaur with the mouse or keyboard. Other dinosaurs in the simulation should probably continue to move as they did in part B of the project.

Your project should continue to be structured using the model/view/controller framework. The model should definitely be separated from the view and controller (with minor exceptions if you implement the drawing code the way it was done in the bouncing ball demonstrations). Depending on how you design your user interface, the view and controller(s) may be separate, but it probably makes sense to, for example, handle mouse events in the same viewer object that draws the window containing the dinosaurs.

The simulation must continue to meet the minimal requirements from part B of the project: at least three distinct kinds of dinosaurs, relatively smooth motion under normal circumstances, etc.

Extra Credit

Some extra credit will be awarded for projects that go substantially beyond the basic requirements. The list at the end of part B has some ideas. In addition, user interactions that go beyond the basic requirements can also be worth extra credit. However, simply adding new dinosaur to the scene in response to a mouse click, for example, wouldn’t be worth extra credit by itself since it is something that was already present in the sample programs shown in classes (and in fact, just doing this would not meet the basic requirements of this part of the project). Joysticks anyone?

What to Turn In

Use this online turnin form to turn in the files that make up your project, including all of the Java source code and tests, and any additional files like pictures that are part of your program.