Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 1.21 KB

File metadata and controls

29 lines (28 loc) · 1.21 KB

Pong-in-Python

Description

This is a simple implementation of a classic Ping Pong game using the Pygame library. Players control paddles to hit a ball back and forth, trying to score points by making the ball pass their opponent's paddle.

How to Play

  1. Use the 'W' key to move the left paddle up and the 'S' key to move it down.
  2. Use the up and down arrow keys to move the right paddle up and down, respectively.
  3. The game will start as soon as you run the script.
  4. The ball will initially move towards a random direction.
  5. Bounce the ball back with your paddle to prevent the opponent from scoring.
  6. The game continues until one player scores a point.
  7. After a score, the ball will reset to the center, and the game will continue.

Installation

  1. Ensure you have Python installed on your system (Python 3.x is recommended).
  2. Install the Pygame library using pip:
pip install pygame

How to run

  1. Download or clone the repository to your local machine.
  2. Navigate to the project directory containing the 'ping_pong.py' file.
  3. Open a terminal or command prompt in that directory.
  4. Run the following command to start the game:
python ping_pong.py

Dependencies

  1. Python 3.x
  2. Pygame