Answered You can hire a professional tutor to get the answer.

QUESTION

import javafx.scene.paint.Color; import javafx.scene.shape.Circle; import javafx.scene.layout.

Create a JavaFX Application named Bounce. In this Application you will use the Ball.java class to draw a red ball in the middle of a 500x500 window. The ball's radius must be 20 pixels. Every 25 milliseconds move the ball by 10 pixels horizontally and 5 pixels vertically. Initially move it 10 pixels horizontally to the right, but as soon as your ball touches the right edge of the window, change its direction to go 10 pixels to the left. Then when it hits the left side, change it back to the right, and so on through an infinite loop. Also, initally move your ball 5 pixels vertically down, but after your ball touches the bottom edge of the window, change its direction to go 5 pixels up instead of down, until it hits the top, and then change its direction again, and so on through the same infinite loop that controls the horizontal direction. Furthermore, whenever your Ball hits any side, change its color to a random set of RGB values that are from 0.3 to 0.7 in the JavaFX Color class.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question