A classic Pong game built with Python, simulating the iconic table tennis arcade experience. Control paddles, compete against a friend or AI, and try to score points before your opponent does. This project is a fun way to practice Python skills and get hands-on with simple game development.
- Two-player mode: Challenge a friendβeach player controls a paddle.
- Single-player mode: Play against computer-controlled opposition.
- Customizable controls and easy to modify.
- Visual score tracking and game-over display.
- Clean and readable, well-documented Python code with the official PEP-8 formatting.
- Clone or Download the repository:
git clone https://github.com/bytesculptor097/pong
cd pong
- Ensure Python 3 is installed on your system.
- Install dependencies:
pip install pygame
- Objective: Use your paddle to bounce the ball past your opponent. Score points each time your opponent misses the ball.
- Win Condition: Reach the set score limit 5 before your opponent.
- Controls:
- Right Paddle:
W(up),S(down) - Left Paddle:
Up Arrow(up),Down Arrow(down) - The ball bounces off paddles and top/bottom walls. Missing returns a point to the opposing side.
To run the game, execute:
python pong.py
Enjoy the game window that appears! For two players, use the assigned keys to control your paddle. Score is displayed at the top.
pong.pyβ Main game file (all logic, drawing, and event handling)assets- All the pictures, sounds etc.
- Python 3
- pygame
- Cross-platform (runs on Windows, macOS, and Linux)
pong_small.mp4
Thank you for your interest in contributing to this Pong game!
Here are some ideas and wishes to improve the game:
- Add the pause and Quit button in the middle of game.
- Add options to customize the paddle and ball (like style colors etc.)
- Add multiplayer support over a network.
- Optimize performance and fix bugs.
If you'd like to help, please feel free to:
- Fork the repository,
- Create a new branch for your feature or fix,
- Submit a pull request with a clear description.
Your contributions are highly appreciated!
This project is released under the MIT License.