/pong-py

In Pong, two players compete, with Player 1 using W (up) and S (down) and Player 2 using O (up) and L (down) to control their paddles. The goal is to hit the ball, preventing it from reaching the opposite screen end. Scoring awards the serving player, and the game proceeds until one player reaches 10 points.

Primary LanguagePythonMIT LicenseMIT

Pong in Python

In the classic game of Pong, there are two players competing against each other. Player 1 controls their paddle using the keys W (up) and S (down), while player 2 uses the keys O (up) and L (down). The objective of the game is to hit the ball with the paddle and prevent it from reaching the opposite end of the screen. The player who scores a point gets to serve the ball, and the game continues until one player reaches the score of 10 points.

How to Run the Game

Before running the game, you need to have Pygame installed in your Python environment. To install it, execute the following command in the terminal:

pip install pygame

Once Pygame is installed, simply execute the AlonePong.py file in your terminal using the command:

python3.9 pong.py

Game Features

Some features of this classic game include:

  • Multiplayer mode with two players;
  • Paddles are controlled by the keys W and S for player 1, and O and L for player 2;
  • The player who scores a point serves the ball, adding an additional challenge to the gameplay;
  • The game ends as soon as one player reaches a score of 10 points;
  • Classic, simple, and recognizable graphics.

Contributions

This project was developed for learning and improving Python and Pygame skills. However, contributions are always welcome! If you encounter any issues in the code or have suggestions for improvements, feel free to open an issue or send a pull request.

License

This project is released under the MIT license. See the LICENSE file for more details.