Assignment 2 – Pet a Kitty

Maximum Points = 50

 The purpose of this lab is to review your study of computer programming and algorithms from CS 1. In this lab you will design and implement an application called “pet a kitty” game.

 

Use an image to represent the cat. Have the cat appear at a random location for a random duration, then disappear and reappear somewhere else. The goal is to “pet the kitty” by pressing the mouse button while the mouse pointer is on the cat image. Design and implement a class that represents a cat, and include a method that determines if the location of the mouse click corresponds to the current location of the cat. Display a count of the number of times the user pets the cat.

 

Here are some examples to look at for ideas:

Whack-a-Mole - http://www.alfy.com/games/playgame.aspx?gameid=257

Pet the Kitty - http://www.i-am-bored.com/bored_link.cfm?link_id=15909

 

Do one or more of the following extra features:

a)    Provide a title screen

b)    Add a background

c)    Change the background color when the user pets the kitty

d)    Have the cat follow (chase) the mouse

e)    Add a collection of cats (different images, different colors) moving around the screen and keep count for each cat

f)     Assign the arrow keys the function to move the cat

g)    Have the cat “purr” and/or meow when you do different things to it.

h)   Anything else that you think might enhance this assignment (check with me first)

 

Due before class on Friday, September 17, 2010) Submit a .doc file containing the UML class diagram showing inheritance for all the classes used in your program and your timesheet documenting your time. [10 pts]

Due before class on Friday, September 24, 2010) Submit your .java files containing your program, a Word document describing your program and your timesheet documenting your time to the dropbox in WebCT.

 Grades are determined using the following scale:

Grading Rubric  (Word document)