This is a classic Pong game implemented in Python using the Pygame library. The project includes two game modes:
๐ฎ Two-Player Mode: Two players compete against each other, each controlling a paddle.
๐ค Single-Player Mode: One player competes against an AI that controls the second paddle.
The game features an interactive menu to select the game mode and the number of points required to win. It also includes sound effects, a scoring system, and an intuitive graphical interface.
โ๏ธ Interactive Menu: Choose between playing against AI or two-player mode.
โ๏ธ Point Selection: Play up to 5 or 10 points.
โ๏ธ Artificial Intelligence: The AI efficiently follows the ball, providing a realistic challenge.
โ๏ธ Sound Effects: Custom sounds for hits, bounces, and scores.
โ๏ธ Graphical Interface: Clean, responsive design with custom colors and centered text.
โ๏ธ Restart & Exit Options: Restart the game, return to the main menu, or exit anytime.
๐ Python: Main programming language.
๐ฎ Pygame: Library for game development in Python.
๐ง AI Logic: Simple algorithm for AI-controlled paddle movement.
๐๏ธ Event Handling: Keyboard events for paddle control and menu navigation.
- Developed a functional and engaging game from scratch.
- Used Pygame to render graphics, manage events, and play sounds.
- Implemented interactive menus with centered text and customizable options.
- Applied custom colors and fonts to enhance the user experience.
- Developed AI to autonomously control the paddle.
- Implemented collision detection and basic physics for ball movement.
- Used keyboard events for paddle control and menu navigation.
- Managed collisions between the ball, paddles, and screen borders.
- Modular and well-structured code with reusable functions.
- Used constants for easy configuration and maintenance.
Ensure you have Python 3.x installed. Install the Pygame library using:
pip install pygame1๏ธโฃ Clone this repository or download the pong.py file.
2๏ธโฃ Navigate to the project directory and run:
python pong.py๐น Press 1 to play against the AI.
๐น Press 2 to play in two-player mode.
๐น Press Q to exit.
๐น Press 5 to play up to 5 points.
๐น Press 10 to play up to 10 points.
๐น Press Q to exit.
๐น Player 1: Use W (up) and S (down).
๐น Player 2 (Two-Player Mode): Use โ (up) and โ (down).
๐น Press R to restart with the same settings.
๐น Press M to return to the main menu.
๐น Press Q to exit.
๐ก Contributions are welcome! If you want to improve the game, follow these steps:
1๏ธโฃ Fork the repository.
2๏ธโฃ Create a new branch:
git checkout -b new-feature3๏ธโฃ Make your changes and commit them:
git commit -m 'Add new feature'4๏ธโฃ Push to the branch:
git push origin new-feature5๏ธโฃ Open a Pull Request.
๐ Name: David Serrano Franco
๐ป GitHub: https://github.com/DavidSerranoFranco
๐ LinkedIn: https://www.linkedin.com/in/david-serrano-franco-77805025b/
This project is licensed under the MIT License. See the LICENSE file for more details.



