Question: Create a C# program code for Vintage Pong In this lab, you will exercise your knowledge of loops to create a 1 9 7 0

Create a C# program code for Vintage Pong In this lab, you will exercise your knowledge of loops to create a 1970's vintage Pong game. In the original Pong game, two players each controlled paddles situated on the right and left side of the screen. A ball moved across the screen, bouncing off the walls, and the paddles. If a player missed the ball with his/her paddle, the ball disappeared and the opposing player scored. Some early home versions of Pong featured a "practice mode", in which you tried to keep a ball in play using your paddle in a three-walled court. We will construct this version, and use the computer's mouse to control the vertical position of the paddle. The game will appear as shown below: You will use the GDIDrawer to create the game. Since the GDIDrawer is a low-performance graphics engine, you should turn off ContinuousUpdate mode, and use a scale of 5.When using a scale of 5,the horizontal window size is 160scaled pixels, and the vertical size is 120scaled pixels. The ball can be drawn as a rectangle with a size of 2,and the paddle is a single line with a thickness of 10pixels.You may wish to customize these values. The 3table edges should be drawn using background scaled pixels, so that they will not be erased when the ball and paddle are cleared from the foreground display. A loop must be used to animate the ball and move the paddle. The ball will have an (x,y)location,and a xVel and yVel velocity that will be used to change the ball's position for each execution of the animation loop. I found using xVel and yVel being one worked best for the start of the game. When the ball hits a wall or the paddle, it will bounce and proceed in the opposite direction by 90degrees.Each time the ball bounces off the paddle, the score is increased by one. You may wish to add a sound when the bounce occurs. The animation loop will require a time delay of about 20ms.to reduce the speed of the ball to a manageable level. If you wish, your game could gradually reduce the time delay each time the paddle hits the ball, so that the ball will gradually speed up as play continues. The y position of the mouse will determine the position of the paddle. Your code must prevent the paddle from moving into the walls and beyond the window. Use the vertical mouse position (read once every animation loop)to position the paddle. Then game starts when the user clicks the left mouse button within the game board. The ball will start from a random position on the left side of the game, and move towards the right side of the board. You may wish to apply some randomness to the yVel when the game starts. The game ends when the ball exits from the left side of the game board. The program will display the final score, and then pause for a short period. Next, the program will then display two "buttons": Play Again and Quit. If the user clicks the Quit button, the program ends. If the user clicks the Play Again button, another round of the game starts. Clicking elsewhere on the screen will be ignored. MAKE SURE TO ADD EVERY PART OF CODE AND USE GDI DRAWER and C# while using only the parameters specified

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 Programming Questions!