Question: Has to be in python!!. For this assignment, you will start with your solution for the bouncing ball lab to implement a simple pong game

Has to be in python!!.

For this assignment, you will start with your solution for the bouncing ball lab to implement a simple pong game with interface as shown in the following figure.

Has to be in python!!. For this assignment, you will start with

Add a label at the top with the same width as the canvas to show the number of lives left until the game is over. The width of the label is the same as the canvas' width. Notice that the width attribute sets a label's width in characters. Using a negative value sets the width in pixels. 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.

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.

your solution for the bouncing ball lab to implement a simple pong

game with interface as shown in the following figure. Add a label

Pong Game Lives left: 5 Pong Game Lives left: 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!