Welcome to the Ping Pong Game โ a classic 2-player arcade game built in Python! This version brings the timeless fun of Pong to your screen using simple game logic and real-time keyboard controls. Itโs a great way to learn about animation, collision detection, player input, and game loop logic in Python. GeeksforGeeks
โจ Two-Player Gameplay Compete locally with a friend โ each player controls a paddle and tries to keep the ball in play!
Player 1 (left paddle): W / S
Player 2 (right paddle): Up / Down arrows GeeksforGeeks
The ball bounces off paddles and screen edges. Miss it and the other player scores! GeeksforGeeks
Scores update in real time so you always know whoโs winning.
Simple visuals focused on gameplay and responsiveness.
##๐ ๏ธ How It Works
This game runs a continuous game loop that:
Draws the paddles and ball on screen
Listens for player input to move paddles
Updates ball movement based on physics
Checks for collisions with paddles and edges
Updates the score when a player misses the ball
The entire logic is handled in one script: ping pong game.py
Make sure you have:
๐ Python installed (3.x recommended)
Clone the repository
git clone https://github.com/ammarr12/ping-pong-game.git
Navigate into the folder
cd ping-pong-game
Run the game
python "ping pong game.py"
Player Keys ๐ฆ Left Paddle W = Up, S = Down ๐ฅ Right Paddle โ = Up, โ = Down ๐ง Learning Goals
๐ Python scripting
๐น๏ธ Real-time keyboard input
๐ Game loops and logic
๐ Collision detection
๐ Score tracking
โค๏ธ Thanks for Checking It Out!
If you enjoy this game or want to improve/change features โ go ahead and fork it, explore the code, and build your own version! Feel free to โญ the repo and share feedback! ๐