Skip to content

The Python Pong Game is a two-player game where each player controls a paddle using keyboard inputs. The goal is to prevent the ball from passing beyond your paddle while attempting to make the ball pass beyond the opponent's paddle.

Notifications You must be signed in to change notification settings

Siya016/pong-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Pong Game

Overview

This is a simple implementation of the classic Pong game using Python and the Turtle graphics library. The game is built using object-oriented programming (OOP) principles to create a modular and extensible structure.

Features

  • Classic Pong gameplay with two paddles and a bouncing ball.
  • Player 1 controls the left paddle with the W and S keys.
  • Player 2 controls the right paddle with the Up and Down arrow keys.
  • Score tracking for both players.
  • Simple collision detection and ball movement.

Requirements

  • Python 3.x
  • Turtle library (usually included in standard Python installations)

Installation

  1. Clone the repository to your local machine:

            git clone  https://github.com/Siya016/pong-game.git

Change into the project directory:

            cd pong-game

  1. Run the game:

               main.py 

How to Play

  • Use the W and S keys to control the left paddle (Player 1).
  • Use the Up and Down arrow keys to control the right paddle (Player 2).
  • The game will start automatically, and the ball will bounce between the paddles.
  • Score is displayed at the top of the window.

Customization

Feel free to customize and extend the game. Here are some ideas:

  • Adjust the game window size by modifying the screen.setup(width, height) function in pong.py.
  • Change the paddle and ball colors by modifying the corresponding attributes in the Paddle and Ball classes.
  • Experiment with different ball speeds by adjusting the self.speed attribute in the Ball class.
  • Implement additional features, such as sound effects, different game modes, or power-ups.

Contributing

If you have suggestions, improvements, or bug fixes, please feel free to open an issue or submit a pull request. Your contributions are welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by the classic Pong game.
  • Built using the Turtle graphics library in Python.

Enjoy the game! 🎮

 

About

The Python Pong Game is a two-player game where each player controls a paddle using keyboard inputs. The goal is to prevent the ball from passing beyond your paddle while attempting to make the ball pass beyond the opponent's paddle.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages