Skip to content

A simple Javascript pong game with the player's pad controlled by the mouse.

License

Notifications You must be signed in to change notification settings

guilhermedom/mouse-ping-pong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mouse Ping Pong

Browser mouse-based ping pong game developed using JavaScript's canvas.

Installing

To play the game you will need to download the .html (game itself) and the .png (background of the game) files on your machine and save them on the same folder.

Once downloaded, you just need to open the .html file using any internet browser.

Rules

Every time the ball reaches the left or the right side of the screen, the player playing on the opposite side scores 1 point. The first to reach 5 points wins the game.

How to Play

The player is supposed to defeat the computer AI by making the ball reach the right side of the screen.

Like in any common pong game, you are supposed to hit the ball whenever it comes close to your side of the screen. Avoid the ball reaching your side of the block.

Use the mouse movement to control your pad. Pushing the mouse forward makes the pad go up and pulling the mouse backwards makes the pad go down.

Game Mechanics

  1. Hitting the ball with the center of the pad reduces its speed and sends it in a more straight direction than it came;
  2. Hitting the ball with the corner of the pad increases its speed and sends it in a zig-zag direction;
  3. Hitting the ball with a faster, or slower, movement does not change its speed;
  4. The ball does not accumulate speed, its speed gets reset once hit by a pad;
  5. The ball can bounce on the upper and lower sides of the block, without losing nor gaining speed.

About

A simple Javascript pong game with the player's pad controlled by the mouse.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages