Welcome to the Pygame Ping Pong Game! This repository contains a classic arcade-style ping pong game developed using Python and the Pygame library. Compete against a friend in a fast-paced battle of reflexes and strategy as you control paddles to hit a ball back and forth across the screen, aiming to outmaneuver your opponent and score points by making the ball pass their paddle.
- Two-Player Gameplay: Challenge a friend in exciting head-to-head matches.
- Simple Controls: Easy-to-learn controls make it accessible for players of all skill levels.
- Customizable Player Names: Personalize your gaming experience by choosing unique player names.
- Adjustable Ball and Paddle Speeds: Tailor the game's difficulty to your liking by modifying the speeds of the ball and paddles.
- Score Tracking and Display: Keep track of your progress with a built-in scoring system.
Ensure you have the following software installed before running the game:
- Python 3.x
- Pygame library
Follow these steps to start playing:
-
Clone the Repository: Download the repository to your local machine using Git or by clicking the "Download ZIP" button.
-
Install Dependencies: If you haven't already installed Python and Pygame, make sure to do so before proceeding.
-
Run the Game:
- Open a terminal or command prompt.
- Navigate to the directory where you cloned the repository.
- Run the
main.py
file using the Python interpreter (python main.py
).
-
Controls:
- Player 1 Controls:
- Use the 'W' key to move the paddle up.
- Use the 'S' key to move the paddle down.
- Player 2 Controls:
- Use the up arrow key to move the paddle up.
- Use the down arrow key to move the paddle down.
- Player 1 Controls:
-
Gameplay:
- Press the space bar to start the game and hit the ball.
- Score points by making the ball pass your opponent's paddle.
- The game ends when one player reaches a score of 5.
Customize the game to your liking:
- Player Names: Modify the
PLAYER1_NAME
andPLAYER2_NAME
variables inmain.py
to change the player names. - Ball Speed: Adjust the
BALL_SPEED
variable inmain.py
to control the speed of the ball. - Paddle Speed: Change the
PADDLE_SPEED
variable inmain.py
to adjust the speed of the paddles.