shwilliam / pong

πŸ“ Vanilla JS pong game

Home Page:https://shwilliam.github.io/pong

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pong

Vanilla JS pong game

Controls

Key(s) Description
a/z P1 UP/DOWN
UP/DOWN P2 UP/DOWN
SPACE Pause

Features

The 'settings' button opens a modal with inputs that allows users to customize game parameters and open the new game with modified settings as URL string parameters. This means that the customized game can be shared and played using the active URL. These settings include toggling a single player mode with variable difficulty, adjusting paddle size, speed, and ball size.

Paddle movement control is handled by the KeyListener class, which listens to all keydown & keyup events on the document and adds/removes the keys to an array of currently pressed keys. This allows for both players to move their paddles simultaneously.

Setup

Install npm dependencies by running npm i. After that finishes you can run npm start to start a Parcel dev server at http://localhost:3000.

About

πŸ“ Vanilla JS pong game

https://shwilliam.github.io/pong

License:MIT License


Languages

Language:JavaScript 75.9%Language:CSS 21.3%Language:HTML 2.8%