A classic Pong game built with Python and Pygame. The objective is to outscore your opponent by hitting the ball past their paddle.
- Installation
- How to Run
- Game Modes
- Sound Effects
- Game Controls
- Gameplay Win Conditions
- File Structure
- Python 3.6 or higher
- Pygame library
Create a folder in Desktop or any where you prefer and clone the repository in the terminal or command prompt inside that folder using this code:
git clone https://github.com/WekesaKelvin/Ping-Pong-game.git
After Cloning the repository Install pygame by running:
pip install pygame
Navigate into the repository folder:
cd Ping-Pong-game
Run the game by executing the following command in your terminal:
python ping_pong_game.py
Single Player: Play against the computer, aiming to beat its AI at varying difficulty levels.
Multiplayer: Compete against another player in a race to 10 points to claim victory.
Players in single-player mode can track their highest scores against the computer.
Easy: Slower ball speed and larger paddles for a relaxed gameplay experience.
Medium: A balanced challenge with moderate ball speed and paddle size.
Hard: High-intensity gameplay with faster ball speeds and smaller paddles for seasoned players.
Dynamic sound effects enhance gameplay: Ball hits the wall. Ball is hit by a paddle. Player wins or loses a match.
-
Player (Right Paddle)
- Move Up: Press the
UP Arrow
key - Move Down: Press the
DOWN Arrow
key
- Move Up: Press the
-
Opponent (Left Paddle)
- Move Up: Press the
W
key - Move Down: Press the
S
key
- Move Up: Press the
Single Player Mode: Aim for the highest score possible against the computer.
Multiplayer Mode: Achieve the highest points within 20 seconds. If you reach the highest score before the timer ends, you win immediately.
Settings Section
- Customize the game settings to adjust difficulty:
- Ball Speed: Increase or decrease the speed of the ball.
- Ball Size: Adjust the size of the ball for a personalized challenge.
- Paddle Speed: Control how fast the paddles move.
- Paddle Size: Modify the paddle size for easier or more challenging gameplay.
- Match Type: Select specific match configurations to suit your skill level.
Game.py - Main game code including game setup, event handling, animations, and main game loop.