Pong

by hl8xgz
See Code Download Embed
For my game, I decided to make two player Pong, a classic arcade game enjoyed by many. I drew sprites (paddles) that represented Players 1 and 2, along with a ball that would move across the screen. Player 1 would be controlled by the W and S keys, with W being to move up and S being to move down. Player 2 would be controlled by the arrow keys, with the down arrow being to move down and the up arrow to move up. The ball had multiple procedures within it that control how the game works. First, the ball is randomly pointed in some direction so that both players get an equal opportunity to start with the ball first. Then the collisions with the paddles is all controlled by a forever loop that causes the ball to bounce back at a range of random angles. If the players were not able to reach the ball and it does not touch their paddles, then the opposing players score would increase by 1 and the ball would be reset to the center of the screen and would proceed to launch in a random direction. This basic process repeats until the first players reaches a score of 11. When the score reaches 11, the ball resets to the middle and declares the victorious player. Power-ups were added to the game that make the ball faster, bigger, and the paddles faster. Other power-ups will continue to be updated and I plan on adding a who touched the power-up last variable so that only 1 player would be affected by certain power-ups or debuffs. 

Created March 29, 2023

Last updated April 24, 2023

Shared April 3, 2023