Skip to content

afa-farkhod/Bouncing-Ball-JavaFX_Animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Bouncing-Ball-JavaFX_Animation

Bouncing Ball JavaFX animation

  • Following program displays bouncing balls and enables the user to add and remove balls, moreover there is sliding bar on top of the window which enables to control the speed of bouncing balls, speed can be increased and decreased respectively.

Image

  • Each ball has its state: the 'x' and 'y' coordinates, color, and direction to move. We can define a class named Ball that extends javafx.scene.shape.Circle. The 'x' and 'y' coordinates and the color are already defined in Circle. When a ball is created, it starts from the upper-left corner and moves downward to the right. A random color is assigned to a new ball. The MultiplBallPane class is responsible for displaying the ball and the MultipleBounceBall class places the control components and implements the control. The relationship of these classes is shown in the following UML diagram.

  • Demo implementation:

Image

Image

Releases

No releases published

Packages

No packages published

Languages