/PingPong

Primary LanguagePython

Pygame Ping Pong Game

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.

Features

  • 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.

Requirements

Ensure you have the following software installed before running the game:

  • Python 3.x
  • Pygame library

How to Play

Follow these steps to start playing:

  1. Clone the Repository: Download the repository to your local machine using Git or by clicking the "Download ZIP" button.

  2. Install Dependencies: If you haven't already installed Python and Pygame, make sure to do so before proceeding.

  3. 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).
  4. 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.
  5. 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.

Customization

Customize the game to your liking:

  • Player Names: Modify the PLAYER1_NAME and PLAYER2_NAME variables in main.py to change the player names.
  • Ball Speed: Adjust the BALL_SPEED variable in main.py to control the speed of the ball.
  • Paddle Speed: Change the PADDLE_SPEED variable in main.py to adjust the speed of the paddles.