CSCI Homework Assignment 4 - Bouncing, Bouncing, Everywhere!

Due Tues Sep 25 at 11:59pm

Introduction

This assignment will give you further chances to practice using loops and collections, as well as to practice working with object interactions. Loops are all about doing the same thing over and over again, and one of the best uses of that is animation! In an animation, you move the animated object a small amount over and over again, which gives the appearance of movement. In this assignment, you will expand the Bouncing Ball program you wrote in lab this week to create an animation of many balls bouncing and changing color!

Note that this assignment should be completed with your lab partner, using pair programming (just like you do in lab)!

The Assignment

UPDATE: There were a few bugs in the back-end and project submitter (pink also now shows as pink). You can download a fixed version of the code here: Homework4_fixed.zip. Note that you will need to copy your existing Ball and BallCourt classes over, either by copying the source code or by moving the .java files from the project folder.

For this program, you and your partner will continue developing your BallCourt class you started in lab. You will make it so your BallCount can have multiple balls bouncing in random directions. In addition, every time two balls touch, they should exchange colors. So if a red ball touches a blue ball, the red ball becomes Blue and the blue ball becomes red.

Be sure to document your code carefully, using Javadoc syntax (e.g., @param, @return) for each method and class you create. Also include comments inside methods to explain how your code works! You can view your code's documentation by selecting "Documentation" from the selector box in the upper right hand corner of the code window, or by selecting "Tools > Project Documentation".

Submitting

Before submitting, test each of your methods and classes thoroughly, and double check for comments above each method and make sure both your and your partner's name is in each class. When you're convinced it's ready to go, submit the project through BlueJ just like you did in the previous Assignments (selecting Hwk4 of course). Be sure to upload to the Hwk4 folder, not the Lab D folder!

Submitter will look for the Ball.java and BallCourt.java files.

Grading

This assignment will be graded on the following criteria: