Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a program that uses objectdraw ActiveObjects to do the following: Creates a window of a user-specified size (prompt the user for this in your
Create a program that uses objectdraw ActiveObjects to do the following":
- Creates a window of a user-specified size (prompt the user for this in your main function before creating the WindowController object)
- Responds to mouse clicks by creating a filled circle of a relatively small radius that moves in a random direction at a random speed. Each new click should create a new circle.
- When these circles reach the edge of the canvas, they should change direction as follows:
- When hitting the top or bottom wall, the y component of their direction of travel should reverse
- When hitting the left or right wall, the x component of their direction of travel should reverse
- At no point should any part of the ball leave the canvas -- for example, you will lose points if the ball goes off the right or bottom of the canvas before reversing direction.
run using java intellij
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started