Welcome to the Ping Pong Game! This project is a simple yet engaging game built with HTML5 Canvas and JavaScript, allowing players to enjoy a classic game of ping pong right from their web browsers.
- Realistic gameplay: Simulates a real ping pong game with responsive paddles controlled by keyboard input.
- Sound effects: Includes sounds for the ball hitting a paddle, scoring a point, and hitting the game walls.
- Score tracking: Keeps track of the player's and AI's scores, displaying them on the canvas.
- Dynamic AI opponent: The AI paddle moves based on the ball's position, providing a challenging gameplay experience.
- Start the game: Open the
game.html
file in a web browser to start the game. - Player control:
- Use the
Up Arrow
key to move the paddle up. - Use the
Down Arrow
key to move the paddle down.
- Use the
- Winning the game: The game continues until either the player or the AI scores 20 points. An alert will be shown for the winner, and the game window will close.
- HTML5
- CSS3
- JavaScript
- Canvas for drawing the game elements.
- Event listeners for paddle control.
To run this project locally:
- Clone or download the project to your local machine.
- Open the
game.html
file in a browser to start playing.