Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🏓 Ping Pong Game — Python Edition 🐍

Welcome to the Ping Pong Game — a classic 2-player arcade game built in Python! This version brings the timeless fun of Pong to your screen using simple game logic and real-time keyboard controls. It’s a great way to learn about animation, collision detection, player input, and game loop logic in Python. GeeksforGeeks

🎮 Game Features

✨ Two-Player Gameplay Compete locally with a friend — each player controls a paddle and tries to keep the ball in play!

⬅️➡️ Keyboard Controls

Player 1 (left paddle): W / S

Player 2 (right paddle): Up / Down arrows GeeksforGeeks

🏓 Ball Physics & Bouncing

The ball bounces off paddles and screen edges. Miss it and the other player scores! GeeksforGeeks

📊 Live Scoring

Scores update in real time so you always know who’s winning.

🎨 Clean Graphics

Simple visuals focused on gameplay and responsiveness.

##🛠️ How It Works

This game runs a continuous game loop that:

Draws the paddles and ball on screen

Listens for player input to move paddles

Updates ball movement based on physics

Checks for collisions with paddles and edges

Updates the score when a player misses the ball

The entire logic is handled in one script: ping pong game.py

🚀 How to Play

🧰 Prerequisites

Make sure you have:

🐍 Python installed (3.x recommended)

📌 Running the Game

Clone the repository

git clone https://github.com/ammarr12/ping-pong-game.git

Navigate into the folder

cd ping-pong-game

Run the game

python "ping pong game.py"

🎮 Controls

Player Keys 🟦 Left Paddle W = Up, S = Down 🟥 Right Paddle ↑ = Up, ↓ = Down 🧠 Learning Goals

This project helped me practice:

🐍 Python scripting

🕹️ Real-time keyboard input

🚀 Game loops and logic

📏 Collision detection

📊 Score tracking

❤️ Thanks for Checking It Out!

If you enjoy this game or want to improve/change features — go ahead and fork it, explore the code, and build your own version! Feel free to ⭐ the repo and share feedback! 🙌

About

A ping pong game made using python library turtle. This project used a lot of geometrical concepts and i mostly used x and y direction. and NO THIS IS NOT MADE BY AI BUT PURELY BY MAKING ALGORITHMS AND TESTING LOGICS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages