Pong Game

The classic game of Pong.

Technologies Used

  • HTML
  • Canvas
  • CSS
  • JavaScript

Installation Instructions

  • Clone or download the repository to your local machine

  • Open the index.html file in your web browser

  • Start playing!

  • You can go to the live demo at here to play the game

How to Play

  • Move your mouse to control the paddle

  • The ball will bounce off the top and bottom walls. If it hits the left or right wall, the ball will reset back to the center of the board and the player will gain 1 point

  • The game ends when either player reaches 10 points

Approach Taken

  • The game is built using the HTML5 canvas element to draw the game board, paddles and the ball

  • The game logic is applied using JavaScript, with CSS used for styling

  • The game uses an object-oriented approach where the game board, paddles and ball are all objects with its own properties. This allows for more functionality to be added to the game in the future

Unsolved Issues

  • The game is currently only playable on a desktop computer. The game will not work on a mobile device.

  • The computer paddle at times will appear to be "stuck" to the top of the board

  • Due to the random velocities set for the ball, it can move very slowly at times when it hits the paddle

Future Features

  • Add sound effects to the game
  • Create a high score board
  • Add light/dark mode

#### Special Thanks Thank you Jenna and Christian for your helpful suggestions towards the game. I really appreciate it!

Built With

Share this project:

Updates