Menu

[Solved]-Python Question Please Use Link Work Problem Https Drivegooglecom Drive Folders 10qfq3nygc Q37270343

PYTHON QUESTION

PLEASE USE THIS LINK TO WORK WITH THISPROBLEM:
https://drive.google.com/drive/folders/10__Qfq3nYgCjvuwSBWHQMr9BvqXAJ78P?usp=sharing

The link above has the file for this problem.

2.1 Pong You will implement a version of the classic pong game, in which the player moves a virtual paddle to deflect a bou

2.1 Pong You will implement a version of the classic “pong” game, in which the player moves a virtual paddle to deflect a bouncing ball, while an opponent with artificial intelligence does the same. The user interacts with the game on the turtle canvas. The gray horizontal bar represents a paddle, and the dotted line is the path of the ball after impact. d represents the distance between the point of impact and the paddle’s center point, which is the only factor in deciding θ The ball will move at a constant speed. Initially, the ball will be in the center of the window, moving in a random direction. The player may control the player’s paddle by using the left and right arrow keys. If the ball hits a paddle, it will deflect off at an angle depending only on what part of the paddle it hits. If the ball hits the exact center of the paddle, will bounce off straight, perpendicular to the paddle i.e. θ-90). If the ball hits the extreme left end of the paddle, it will bounce off left, at a 30 degree angle relative to paddle (ie. θ 30). If the ball hits the extre e right end of the paddle, it will deflect at a 30 degree angle to the right (i.e. -150). The angle of bounce in other positions is proportional between the extremes of 30 and 150 degrees. If the ball hits a wall, its vertical velocity will not change, but its horizontal velocity will be mirrored, i.e. it will move at the same speed in the opposite direction. If a paddle fails to hit the ball, that player’s opponent will gain a point, and the game will continue with the ball moved to the center of the window, with its direction randomized. The position of the paddles will not be reset. The total number of points for each player is displayed on the left side of the screen The opponent’s paddle must make a reasonable attempt to deflect the ball. You are responsible for designing its artificial intelligence. l’he game ends when the player’s opponent reaches a score of 5 points. At that time, the player’s score will be considered for inclusion in the high score table. The high score table will consist of the best 10 scores that have been won by players, along with the players’ names. The high score table must be stored in a file, so that its contents will persist between multiple plays of the game. If the player’s score is among the 10 highest, or if at least 10 scores have not yet ben recorded, then the player will be prompted in a dialog box to enter their name, whereupon their name and score will be saved into the table. Whether or not th<e player qualifies for a high score, the current high score table will be displayed, from highest to lowest, in the turtle window when the game ends. If the game has never been played before, assume the high score table is empty. Getting started We provide you with starter code to help you begin this project. See the file in starter.zip. This is a starting point; you should replace the pass lines with code to perform the ap- propriate actions in strict accordance with the given specifications. Show transcribed image text 2.1 Pong You will implement a version of the classic “pong” game, in which the player moves a virtual paddle to deflect a bouncing ball, while an opponent with artificial intelligence does the same. The user interacts with the game on the turtle canvas. The gray horizontal bar represents a paddle, and the dotted line is the path of the ball after impact. d represents the distance between the point of impact and the paddle’s center point, which is the only factor in deciding θ The ball will move at a constant speed. Initially, the ball will be in the center of the window, moving in a random direction. The player may control the player’s paddle by using the left and right arrow keys. If the ball hits a paddle, it will deflect off at an angle depending only on what part of the paddle it hits. If the ball hits the exact center of the paddle, will bounce off straight, perpendicular to the paddle i.e. θ-90). If the ball hits the extreme left end of the paddle, it will bounce off left, at a 30 degree angle relative to paddle (ie. θ 30). If the ball hits the extre e right end of the paddle, it will deflect at a 30 degree angle to the right (i.e. -150). The angle of bounce in other positions is proportional between the extremes of 30 and 150 degrees. If the ball hits a wall, its vertical velocity will not change, but its horizontal velocity will be mirrored, i.e. it will move at the same speed in the opposite direction. If a paddle fails to hit the ball, that player’s opponent will gain a point, and the game will continue with the ball moved to the center of the window, with its direction randomized. The position of the paddles will not be reset. The total number of points for each player is displayed on the left side of the screen The opponent’s paddle must make a reasonable attempt to deflect the ball. You are responsible for designing its artificial intelligence. l’he game ends when the player’s opponent reaches a score of 5 points. At that time, the player’s score will be considered for inclusion in the high score table. The high score table will consist of the best 10 scores that have been won by players, along with the players’ names. The high score table must be stored in a file, so that its contents will persist between multiple plays of the game. If the player’s score is among the 10 highest, or if at least 10 scores have not yet ben recorded, then the player will be prompted in a dialog box to enter their name, whereupon their name and score will be saved into the table. Whether or not th

Expert Answer


Answer to PYTHON QUESTION PLEASE USE THIS LINK TO WORK WITH THIS PROBLEM: https://drive.google.com/drive/folders/10__Qfq3nYgCjvuwS… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *