Languages Java Graphics  

Billiard Balls

download download  
important code information
author:
Jeff Crowe
minimum requirements:
Billiard Balls description

Any number of balls (specified by a constant) will bounce around the screen, bouncing off of each other and the walls with perfectly elastic collisions. Uses a thread to control the balls and double buffering to repaint without flickering. The balls are randomly sized and colored and their mass depends on their size. (The theory behind collisions explained in collisions method of code.)


File List:
Billiards.java15Kb

Similar code
Magnifier (Popularity: ) : Magnifier lens that provides a way to enlarge items on the screen.

a 3d Shapes using math object (Popularity: ) : This code generats nice 3d shapes using the Math.cos and Math.sin objects. i think every programmer should play with those, i tell my students to try and make a char like '*' go in circles around the screen.

Bounce Ball - Project2 (Popularity: ) : Bounces 2 balls around the screen. Can be easily modified to allow more than 2 balls. The user can adjust the speed of the balls seperately while the program is running.
Soothing Rain (Popularity: ) : Soothing Rain Drops. Includes three classes. SRainDrop, SRainPanel, and SRainFrame. All classes are commented, but the code is simple enough. The Rain Drops fall into a pond and leave a circle. See screen shot. Please leave comments. Thank you.
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Rate me
supported os
stats
downloads 52
version
size in Kb 5
popularity   941/7913374
user rating 4/10
ad


New Code
Popular Code