Lab 2

A Simple Hockey Game

January 26, 2006

Lab Partners

Everyone should work with one lab partner on this assignment. If you don't know anyone, just ask your lab TA and he will help you to find one. When you work with a partner, submit just one solution with both of your names on it.

Objective

The goals of this lab are to help you (1) become better acquainted with event handling in Java and (2) gain practice writing Javadoc comments .

Assignment

Take the lecture code that we talked about on Wednesday, January 25th and modify it so that the drop down menu has four options: up, down, left and right. When the up option is chosen, the black hockey puck should move 20 pixels towards the top of the screen. When the down option is chosen, the black hockey puck should move 20 pixels towards the bottom of the screen. When the left option is chosen, the black hockey puck should move 20 pixels to the left. When the right option is chosen, the black hockey puck should move 20 pixels to the right.

Requirements and Grading

What to Submit

E-mail your code to your lab TA in one message with the following subject: CS 221-xx inlab2 name1, name2. The xx is the number of your lab section.

Before You Leave

Delete the BlueJ project that you created. Empty the recycle bin. Thank you.