Chris and Kevin’s Paddle Pong Deluxe

Content

 For this project we created an interactive video game on LabVIEW that was inspired by the classic Pong game. The basis of the game is that there are two thin paddles, one on the left of the screen and the other on the right side. These paddles have a fixed horizontal position and a variable vertical position, in other words the paddles can move up and down on the screen but not left or right. This paddle movement is controlled by the player using a wheel attached to a motor, if you turn the wheel in one direction the paddle moves up and if it is turned in the other direction then it moves down. The other component is that there is a ball that bounces around the screen. This ball intially starts in the middle of the screen and moves diagonally across the screen. It bounces off the top and bottom of the screen as well as the sides of the paddles. However, if it goes off the left or right side of the screen it resets to some randomized point in the middle. 

The point of the game is to control one of the paddles and make sure the ball does not cross onto your side. If the ball crosses onto your side the opposing player gains a point. The game ends when one of the players reaches a score of 10 points. Some options that can be changed via the front panel to fit players' play style is the speed at which the paddles move and the speed at which the ball moves across the screen. This in turn allows
the players to tailor the difficulty of the game to their skill level.

There are two versions of the game which are very similar with one essential difference in the code. The difference is that one version is for 2 players while the other can be enjoyed by a solo player. For the 2 player version, both paddles are controlled by the reading of a motor rotation. Player 1 uses one motor while player 2 uses another motor. For the 1 player version the second paddle is controlled by the computer, in that it moves back and forth on the screen by itself. This difference in code can be seen in the block diagram where the position of the second  paddle is determined. 

The code can be broken up into several large tasks that come together to make the game as a whole. The first section is the part that calls in the outside images such as the side logo, the paddles, and the background. The second section is the part that controls the locations of the paddle based on the motor inputs. The third section controls the location of the ball and tells it when to change direction because of a collision. The fourth section is defining what a collision actually is based on the positions. The fifth section is the sound made when the balls goes off screen or if it collides with a paddle. The last section is the scorekeeping which adds one point to the opposing side if the ball goes off the screen.

Gallery
Video
Video
Attachments
AttachmentTypeSize
finalponggame_582a3974f243cFinal Pong Game.zip157.01 KB

Leave a Reply

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