Skip to content

ammarr12/ping-pong-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages