A simple Ping Pong game built using HTML, CSS, and JavaScript. This is a classic two-player game where you control paddles and try to score points by hitting the ball past the opponent's paddle.
This project is a browser-based Ping Pong game, where two players control paddles and attempt to score by bouncing the ball back and forth. The game tracks the score for each player and announces a winner when the score limit is reached. It features smooth animations, keyboard controls, and simple game logic.
- Two-Player Gameplay:
- Player 1 uses the W and S keys to move their paddle up and down.
- Player 2 uses the Arrow Up and Arrow Down keys to move their paddle up and down.
- Scoring System:
- Players score a point when the opponent misses the ball.
- Score is displayed at the top of the screen.
- Game Reset:
- After a player reaches the winning score, the game automatically resets.
- Smooth Animations:
- The ball bounces smoothly across the screen, creating a realistic game experience.
- Responsive Design:
- The game works on various screen sizes (desktop and mobile).
- HTML:
- Structure of the game (gameboard, paddles, ball, score display).
- CSS:
- Styling for paddles, ball, background, and UI elements.
- JavaScript:
- Game logic for movement, collision detection, scoring, and game resetting.
- Open the game in your browser.
- Player 1 controls the left paddle with the W (up) and S (down) keys.
- Player 2 controls the right paddle with the Arrow Up (up) and Arrow Down (down) keys.
- The objective is to hit the ball with your paddle and prevent it from passing by. Score a point when your opponent misses the ball.
- When a player reaches the winning score (usually 10 points), the game resets automatically.
- The game ends when a player wins. You can then start a new game by pressing a button.
ping-pong-game/ ├── index.html // Main HTML file ├── styles.css // CSS file for styling ├── script.js // JavaScript file for game logic └── README.md // Project documentation
- Download or clone the repository: git clone https://github.com/satyam-software-developer/Ping-Pong-Game.git
- Open the index.html file in any modern browser (e.g., Chrome, Firefox, Edge).
- Start playing the game!
- Add a single-player mode where you can play against the AI.
- Improve paddle movement with smooth transitions and animations.
- Add sound effects when the ball bounces or a player scores a point.
- Display a message or animation for the winner after the game ends.
Feel free to fork the repository, make changes, and submit a pull request. Contributions are always welcome!
This project is open source and available under the MIT License.
https://satyam-software-developer.github.io/Ping-Pong-Game/
Developed by Satyam Kumar