Project 3.6: Bounce Back
Create a program with hundreds of bouncing balls
REQUIREMENTS
Create a program that displays hundreds of bouncing balls
You must have at least 200 balls that bounce around the screen
Each ball should be assigned a starting position, color, speed, and size at creation
The balls should start at a random point on the screen.
The ball should be assigned a random color.
The xSpeed and ySpeed should be between -5 and 5.
The ball should be 20 pixels tall and 20 pixels wide.
The balls do not need to interact with each other - they'll move right through
FAQ / Tips
Step-By-Step
Build a simple Ball class
Random starting x and y position
Have an array of Ball objects
Make them display (write a "render" method)
Make them move (write an "update" method)
Add in more functionality to the Ball class
Different colors
Bouncing off the edges
Any other advice?
This project is a mix of Snowfall and Bounce
Use your old projects as a reference if you get stuck
This is pretty straightforward if you understood those two previous projects!
EXAMPLE: RUNNING PROGRAM
Click here to download a running version of the program.