Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afa-farkhod/bouncing-ball-javafx_animation

Bouncing Ball JavaFX animation
https://github.com/afa-farkhod/bouncing-ball-javafx_animation

bouncing-ball java javafx

Last synced: about 1 month ago
JSON representation

Bouncing Ball JavaFX animation

Awesome Lists containing this project

README

        

# 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