Relive the nostalgia of a retro classic! This project is a straightforward yet engaging implementation of the iconic Pong game, built using core web technologies: HTML, CSS, and JavaScript. It features an AI opponent, adjustable difficulty, interactive elements, full responsiveness, and touch controls to provide a fun and familiar experience for all players.
- Player vs. AI: Challenge a computer-controlled opponent that adapts to different skill levels.
- Adjustable Difficulty: Choose between
Easy
,Medium
, orHard
modes to control the AI's responsiveness and the ball's speed. - Interactive Screens: A welcoming start screen allows you to enter your name, and a clear game over screen provides a quick "Play Again" option.
- Pause & Resume: Take a break anytime with a simple pause/resume function.
- Score Tracking: Keep track of both player and AI scores in real-time.
- Countdown System: A "3-2-1-GO!" countdown adds a nice touch before each round.
- Engaging Sound Effects & Background Music: Enjoy distinct sounds for game events and atmospheric background music.
- Full Responsiveness: Optimized for play on both desktop and mobile devices.
- Touch Controls: Intuitive touch-and-drag controls for mobile gameplay.
- Browser-Based: No downloads needed – play directly in your web browser.
- Start Your Game:
- (Optional) Enter your name on the welcome screen.
- Click the "Play Game" button to begin your match.
- Control Your Paddle:
- Desktop: Move your mouse cursor up and down to control your paddle.
- Mobile: Tap and drag anywhere on the canvas (game area) to move your paddle.
- Pause & Resume:
- Click the "Pause" button (which will change to "Resume") to take a break or continue.
- Change Difficulty:
- Select your preferred difficulty from the dropdown menu (Easy, Medium, Hard) at any time.
- Play Again:
- After a game concludes, click "Play Again" on the game over screen to start a new match.
Ready to play? Click the link below to launch the game directly in your browser:
- HTML5: Provides the foundational structure for the game and content.
- CSS3: Styles the game elements, user interface, and ensures responsiveness across devices.
- JavaScript (ES6+): Implements all the game logic, animations, AI behavior, audio handling, and dynamic UI updates.
To run this project on your local machine:
- Clone the repository:
git clone [https://github.com/Akki-jaiswal/pong-game.git](https://github.com/Akki-jaiswal/pong-game.git)
- Navigate to the project directory:
cd pong-game
- Serve with a local web server (Recommended):
To ensure all features (especially module imports for JS and sound playback) work correctly, use a local web server like
http-server
or VS Code's Live Server extension.- Using
http-server
:npm install -g http-server # If you don't have it installed http-server # Run this command from within your 'pong-game' directory
- Then open your browser to
http://localhost:8080
(or the address provided byhttp-server
).
- Using
We welcome contributions from everyone! If you're participating in GSSoC'25 or just want to help improve the game, here's how to get started:
- Read our Contribution Guidelines: For detailed steps on setting up, finding issues, and submitting Pull Requests, please see our
CONTRIBUTING.md
file. - Join our Community: If you have questions, need help, or want to discuss ideas, join our Discord channel: ➡️ Join our Discord Server!
This project is open-source and available under the MIT License. See the LICENSE
file for more details.
- Inspired by the original Pong game for endless classic fun.
- Sound effects sourced from FreeSound.org, mixit.com.