Applying physics on a ball in JAVA
The ball bounces when it touches the platform or the ground. The difference between them is that, the ball loses some energy when it touches the ground, while it doesn't lose energy on the platform.
The ground also exhibits friction which stops a rolling ball.
Move the ball with the Left and Right Arrow keys and lift it using the Space Key.