Skip to content

DavidSerranoFranco/PongGame-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Pong Game with AI - Python & Pygame


๐Ÿ“œ Project Description

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.


โœจ Main Features

โœ”๏ธ 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.


๐Ÿ› ๏ธ Technologies Used

๐Ÿš€ 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.


๐Ÿ† Skills Demonstrated

๐ŸŽฎ Game Development

  • Developed a functional and engaging game from scratch.
  • Used Pygame to render graphics, manage events, and play sounds.

๐ŸŽจ UI/UX Design

  • Implemented interactive menus with centered text and customizable options.
  • Applied custom colors and fonts to enhance the user experience.

๐Ÿง  Programming Logic

  • Developed AI to autonomously control the paddle.
  • Implemented collision detection and basic physics for ball movement.

๐ŸŽฎ Event & Input Handling

  • Used keyboard events for paddle control and menu navigation.
  • Managed collisions between the ball, paddles, and screen borders.

๐Ÿ—๏ธ Code Organization

  • Modular and well-structured code with reusable functions.
  • Used constants for easy configuration and maintenance.

๐Ÿš€ Installation & Execution

๐Ÿ“Œ Requirements:

Ensure you have Python 3.x installed. Install the Pygame library using:

pip install pygame

โ–ถ๏ธ Run the Game:

1๏ธโƒฃ Clone this repository or download the pong.py file. 2๏ธโƒฃ Navigate to the project directory and run:

python pong.py

๐Ÿ“ธ Screenshots

๐Ÿ–ฅ๏ธ Main Menu

ย 

๐ŸŽฎ Two-Player Mode / ๐Ÿค– Single-Player Mode (VS AI)

๐Ÿ”„ Restart Menu


๐ŸŽฎ How to Play

๐Ÿ  Main Menu:

๐Ÿ”น Press 1 to play against the AI.
๐Ÿ”น Press 2 to play in two-player mode.
๐Ÿ”น Press Q to exit.

๐ŸŽฏ Point Selection:

๐Ÿ”น Press 5 to play up to 5 points.
๐Ÿ”น Press 10 to play up to 10 points.
๐Ÿ”น Press Q to exit.

๐ŸŽฎ Controls:

๐Ÿ”น Player 1: Use W (up) and S (down).
๐Ÿ”น Player 2 (Two-Player Mode): Use โ†‘ (up) and โ†“ (down).

๐Ÿ”„ Restart Options:

๐Ÿ”น Press R to restart with the same settings.
๐Ÿ”น Press M to return to the main menu.
๐Ÿ”น Press Q to exit.


๐Ÿค Contributions

๐Ÿ’ก 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-feature

3๏ธโƒฃ Make your changes and commit them:

git commit -m 'Add new feature'

4๏ธโƒฃ Push to the branch:

git push origin new-feature

5๏ธโƒฃ Open a Pull Request.


๐Ÿ‘ค Author

๐Ÿ“Œ Name: David Serrano Franco
๐Ÿ’ป GitHub: https://github.com/DavidSerranoFranco ๐Ÿ”— LinkedIn: https://www.linkedin.com/in/david-serrano-franco-77805025b/


๐Ÿ“œ License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

๐ŸŽฎ A fully functional Pong game featuring two modes: 1 Player (VS AI) and 2 Players. Includes interactive menus, sound effects, and customizable winning scores.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages