A classic Pong game built using Python and Pygame where the player competes against an AI-controlled opponent.
The game includes score tracking, collision mechanics, win conditions, and restart functionality.
- Classic Pong gameplay
- AI-controlled opponent
- Smooth paddle movement
- Ball collision physics
- Real-time score display
- First-to-5 winning system
- Game Over and Victory screen
- Restart option using SPACE key
- Clean and simple UI
| Key | Action |
|---|---|
| W | Move paddle up |
| S | Move paddle down |
| โ Arrow | Move paddle up |
| โ Arrow | Move paddle down |
| SPACE | Restart game after match ends |
| Close Window | Exit the game |
- The player controls the left paddle.
- The AI opponent automatically follows the ball.
- The ball bounces off:
- Top wall
- Bottom wall
- Both paddles
- Missing the ball gives the opponent a point.
- The game ends when either player reaches 5 points.
- Pressing SPACE resets the game and starts a new match.
pong-game/ โ โโโ pong.py # Main game source code โโโ README.md # Project documentation โโโ .gitignore # Ignored files for Git โโโ LICENSE # MIT License
๐ Future Improvements
Some features that can be added in the future:
๐ Sound effects and background music ๐จ Better graphics and animations ๐งโ๐คโ๐ง Multiplayer mode ๐ Increasing difficulty levels โก Ball speed progression ๐ Main menu and pause screen ๐ฏ Smarter AI opponent ๐ Visual particle effects
๐ ๏ธ Technologies Used Python Pygame
๐ License
This project is licensed under the MIT License.
๐จโ๐ป Author
Simran Sajid
Built with Python and Pygame.