Welcome to the Pong game. It's a simple implementation of the classic Pong arcade game, made with the help of the pygame
library. Two players can play this game on the same keyboard.
Before you can run the game, ensure that you have the following installed:
-
Python: This game was developed using Python. Make sure you have Python installed. You can download it from Python's official website.
-
Pygame: This game uses the
pygame
library. If you haven't already installed it, you can do so using pip:pip install pygame
The ball moves diagonally across the screen. When it touches the top or bottom of the screen, it bounces off. If it touches one of the paddles, its horizontal direction is reversed. If the ball goes past a paddle and touches the side of the screen, the opposing player scores a point.
Each player controls a paddle using the keyboard. The paddles can only move vertically.
-
Left Paddle Controls:
W
: Move upS
: Move down
-
Right Paddle Controls:
Arrow Up
: Move upArrow Down
: Move down
To play the game, simply navigate to the directory containing pong.py
and run:
python pong.py
The game window will open, and the ball will start moving. Use the keyboard controls to move your paddle and try to prevent the ball from passing it. The score is displayed at the top of the screen. The game continues until you close the game window.
Enjoy the game! Feel free to modify the code to add more features or adjust the game mechanics. If you encounter any issues or have suggestions, please reach out.