https://github.com/KalbarczykDev/PongJS
This is a simple implementation of the classic Pong game using HTML canvas and JavaScript. Inspired by Marcin's Monskała Book "JavaScript from scratch".
https://github.com/KalbarczykDev/PongJS
begginer-friendly begginer-project beginner beginner-friendly css html html5-audio html5-canvas html5-game javascript javascript-vanilla
Last synced: 2 months ago
JSON representation
This is a simple implementation of the classic Pong game using HTML canvas and JavaScript. Inspired by Marcin's Monskała Book "JavaScript from scratch".
- Host: GitHub
- URL: https://github.com/KalbarczykDev/PongJS
- Owner: OsLint
- Created: 2022-06-15T11:30:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-17T11:56:44.000Z (over 2 years ago)
- Last Synced: 2024-10-12T18:22:45.157Z (about 1 year ago)
- Topics: begginer-friendly, begginer-project, beginner, beginner-friendly, css, html, html5-audio, html5-canvas, html5-game, javascript, javascript-vanilla
- Language: JavaScript
- Homepage:
- Size: 5.87 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pong Game
This is a simple implementation of the classic Pong game using HTML canvas and JavaScript.
Inspired by Marcin's Monskała Book "JavaScript from scratch".## Gameplay
The game is played by two players, each controlling a paddle on opposite sides of the canvas. The objective is to hit the ball with the paddle and prevent it from reaching the player's side. The ball will bounce off the top and bottom walls as well as the paddles. When the ball passes the paddles and reaches a player's side, the opponent scores a point. The game continues until one player reaches a certain number of points, typically 10.
## Controls
- Player 1 (left paddle):
- Move Up: W key
- Move Down: S key- Player 2 (right paddle):
- Move Up: Up Arrow key
- Move Down: Down Arrow key- Pause/Resume: B key
## Demo
To try the game, open the `index.html` file in a web browser. Use the controls mentioned above to move the paddles and hit the ball. Press the B key to pause or resume the game.
## Acknowledgments
This project was inspired by the classic Pong game and was created as a learning exercise. It utilizes HTML canvas and JavaScript to implement the game mechanics. The code was developed based on Marcin's Monskała Book "JavaScript from scratch".
## AuthorOskar Kalbarczyk
https://linktr.ee/codewithoskarFeel free to reach out if you have any questions or feedback.