Question: Directions For this assignment, you will start with your solution for the angular bouncing ball animation lab to implement a simple pong game with interface



Directions For this assignment, you will start with your solution for the angular bouncing ball animation lab to implement a simple pong game with interface as shown in the following figure. Pong Game Lives left: 5 Add a label at the top to show the number of lives left until the game is over. The diagram above uses a Verdana 20pt font but you may use any font that is different from tkinter's default font. Draw a paddle at the center of the canvas' bottom edge as shown in the above diagram. The paddle's width and height are 80 and 20 pixels, respectively. Whenever the user presses the left arrow button, the paddle moves 5 pixels to the left. Likewise, when the user presses the right arrow bottom, the paddle moves 5 pixels to the right. The paddle never moves beyond the right or left edges of the canvas. Remark: If you did this week's exercise, you could incorporate your code for the paddle from there. The user wants to use the paddle to catch the ball so that it does not hit the bottom wall. Every time the ball hits the bottom wall, the player loses a life and the number of lives left is updated on the label. The game will end when number of lives left is 0. When the game ends, move the ball to its initial position near the top left corner of the canvas. Start the game with 5 lives. Every time the ball hits the paddle, it will bounce off the top of the paddle. Notice that a collision between the paddle and the ball occurs when any part of the ball hits the top surface of the paddle. Sample screen shots are shown below. Pong Game Lives left: 3 - Pong Game Lives left: 0 Notice how ball moves to the top-left corner when the game ends. Use comments to document and explain your code where needed and use descriptive variables' names. Notice that points can be deducted for not using descriptive variables' names. No grade above 60 will be given for a program that does not run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
