Computer Science 120
Introduction to Programming
Spring 2011, Siena College
For the second programming project, you are to develop a Java program to play a game where you click on bouncing balls. There are some basic requirements, but many of the game's details are up to you.
You must work alone on the program. You may ask your instructor questions, but help will be limited. You may not discuss the program with anyone else including your classmates and the computer science tutors until after everyone has submitted their programs. You may consult your own graded or ungraded lab submissions, your own class notes, and any class examples or notes available from the course web page. Think of this as an open-book lab exam. Any collaboration or consultation of unauthorized sources will be considered a breach of academic integrity and will be dealt with according to the course policies outlined on the syllabus.
While no design will be graded for this program, coming up with a written design is likely to be a beneficial first step.
Note that a significant portion of the credit for the project is for style, design, documentation, and efficiency. While everyone should strive to earn all of the correctness points, you may find that a well-designed, thoroughly-commented program that makes appropriate use of variables and constants but does not quite implement all functionality will earn a higher grade than a perfectly-functioning program that uses poor variable names, does not use named constants, is uncommented, or is poorly formatted.
Have fun and good luck!
Click-a-Ball Game
For this program, you are to develop a class BallGame (an extension of WindowController) that draws a playing field and creates Ball objects that move around the canvas until they are clicked. The requirements are as follows.
A working solution for the basic functionality of this program will appear below. Click inside the applet to interact with it.
Submitting Your Work
Before the start of your next lab session, submit your Java programs for grading. There are three things you need to do to complete the submission: (i) place a copy of your Javas program into your csis120/hw folder under hw9, (ii) print a copy of each of your programs and hand it to your lab instructor, and (iii) demonstrate the execution of your programs for your instructor.
Grading Sheet
This project is worth 100 points, which are distributed as follows:
> Feature | Value | |
Documentation, Style, Design, and Efficiency (28%) | ||
Appropriate comments | 6 | |
Good variable names and declaration types | 3 | |
Good use of constants | 4 | |
Appropriate formatting | 3 | |
General efficiency | 4 | |
Good overall design | 4 | |
Typed instructions submitted with program | 4 | |
Basic Functionality (54%) | ||
Draw new ball on mouse click | 5 | |
Ball moves on screen | 3 | |
Ball size randomly generated | 5 | |
Ball color randomly generated | 5 | |
Ball speed randomly generated | 6 | |
Ball stays on playing field | 10 | |
Ball disappears when clicked | 10 | |
ArrayList of balls on screen maintained | 10 | |
Enhanced Functionality (18%) | ||
Total | 100 | |