Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shamikaredkar/ping-pong-game

This interactive game leverages fundamental web technologies to simulate a classic Ping Pong match against a sophisticated AI opponent. It features collision detection algorithms, event-driven user input handling for paddle control, and utilizes audio elements for enhanced gameplay feedback.
https://github.com/shamikaredkar/ping-pong-game

aigame arcade-game canvas canvas-game html5-game html5canvas interactive-game javascript javascript-game

Last synced: about 2 months ago
JSON representation

This interactive game leverages fundamental web technologies to simulate a classic Ping Pong match against a sophisticated AI opponent. It features collision detection algorithms, event-driven user input handling for paddle control, and utilizes audio elements for enhanced gameplay feedback.

Awesome Lists containing this project

README

        

![Gameplay Demo](https://github.com/shamikaredkar/Ping-Pong-Game/blob/main/Preview.gif)

# Ping Pong Game

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.

## Features

- **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.

## How to Play

- **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.
- **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.

## Technologies Used

- **HTML5**
- **CSS3**
- **JavaScript**
- Canvas for drawing the game elements.
- Event listeners for paddle control.

## Setup

To run this project locally:
1. Clone or download the project to your local machine.
2. Open the `game.html` file in a browser to start playing.