Windows Systems Programming: Spring 2004

[ Home | Syllabus | Course Notes | Assignments | Search]


Assignment 2: Click the Center

Description: This program tests the ability of the hand/eye coordination of the user. When the program is started it will display a circle in a random position on the screen. The user must click the mouse as close to the center as possible. The program will then move the circle to another randomly chosen place and the user will again click the mouse on the center. The program will measure the accuracy of the clicks measured as the distance from the click to the center of the circle. It will display the average distance from the center as the game progresses.

Due: Feb 11. Please email to "cs477@cs.odu.edu"

FUNCTIONAL REQUIREMENTS:

  1. For displaying the circle, divide the screen's width by 10. This defines the diameter of the circle to be displayed.
  2. The diameter of the circle will change as the window is resized.
  3. After the user has clicked the mouse, you will display the true center of the circle as a black dot and the position of the mouse click as a blue dot. You will also display the distance of the click from the center. If the distance is greater than the current average, it will be displayed in RED letters, otherwise in GREEN letters.
  4. After a short period of time, your program will erase the screen and move the circle to another, randomly chosen, position on the screen. When choosing a random position, reject those locations where the center of the circle would not appear in the window. Thus you must generate random positions until one is generated whose center is in the window.
  5. You must display the current average distance of the user's mouse click from the center of the circle.

IMPLEMENTATION REQUIREMENTS:

  1. You must use C# and the .NET FCL window forms library
  2. Your solution should use good object oriented design and be well written and documented.

 

[http://www.cs.odu.edu/~wild/windowsNT/Spring01/footer.htm]
Copyright chris wild 1999-2004.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: February 05, 2004.