use Pyhton. The tossball simulation we developed together in class is attached to this week's notes. Study it carefully to understand exactly what it is doing. It currently launches a ball in the main graphics window. You need to make the following changes and improvements and send me at the end your finished project in zipped folder format. Only python modules should be included. 1) Add a new class named "Cannon". This class it to represent the cannon that launches the balls. It should draw a rectangle (hint: use Polygon class from Graphics.py) at the launch point. Its width should be equal to the diameter of the balls that it shoots out and its length should be proportional to the speed, say something like speed * 0.15. The cannon should also be directed in the same direction that the balls shooting. Add proper width, height, and angle attributes to the class for supporting the settings above. The balls should start from the bottom of the cannon and be projected out through the cannon pipe. 2) Add an input field to InputDialog to allow for choosing the radius of the ball. Currently the ball radius is set to 3. By this change you make it possible to select how small or large the ball will be. 3) Modify the simulation so that the flight track of the ball is drawn to the screen as the ball flies through its path. The track should disappear after ball hits the ground or goes out of screen. 4) Add a Target bar to the x axis. A target should be a thin rectangle placed at a random x position. Its width should be twice as large as the radius of the ball. Any time the ball hits the target a text should show up in the middle of screen saying "SUCCESS! Hurry!". THe text should disappear as soon as user shoots n

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter12: Event-driven Gui Programming, Multithreading, And Animation
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
100%

use Pyhton.

The tossball simulation we developed together in class is attached to this week's notes. Study it carefully to understand exactly what it is doing. It currently launches a ball in the main graphics window. You need to make the following changes and improvements and send me at the end your finished project in zipped folder format. Only python modules should be included.

1) Add a new class named "Cannon". This class it to represent the cannon that launches the balls. It should draw a rectangle (hint: use Polygon class from Graphics.py) at the launch point. Its width should be equal to the diameter of the balls that it shoots out and its length should be proportional to the speed, say something like speed * 0.15. The cannon should also be directed in the same direction that the balls shooting. Add proper width, height, and angle attributes to the class for supporting the settings above. The balls should start from the bottom of the cannon and be projected out through the cannon pipe.

2) Add an input field to InputDialog to allow for choosing the radius of the ball. Currently the ball radius is set to 3. By this change you make it possible to select how small or large the ball will be.

3) Modify the simulation so that the flight track of the ball is drawn to the screen as the ball flies through its path. The track should disappear after ball hits the ground or goes out of screen.

4) Add a Target bar to the x axis. A target should be a thin rectangle placed at a random x position. Its width should be twice as large as the radius of the ball. Any time the ball hits the target a text should show up in the middle of screen saying "SUCCESS! Hurry!". THe text should disappear as soon as user shoots next ball.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage