Build a Two-Player Pong Game with JavaScript Using qKit

Fahad Haidari
6 min readJan 6, 2020
Two players Pong using qKit

In this article I’m going to show you how to build a two-player classic Pong game with JavaScript, using a 2D game library called qKit

But what is qKit?

qKit is JavaScript library I built to help me build 2D video games easily and quickly.

Also, it’s worth mentioning that it only deals with quadratic shapes (squares and rectangles). You can also check for collisions, detect Keyboard/Mouse inputs, and sounds, and many other utilities that make the 2D game development smooth, easy, and quick. Don’t worry, the documentation of the library does cover most of the things you can do with it in its GitHub repo.

Also, there are tons of examples included.

History?

From Wikipedia Pong is a table tennis sports game featuring simple two-dimensional graphics, manufactured by Atari and originally released in 1972. It was one of the earliest arcade video games and created by Allan Alcorn as a training exercise assigned to him by Atari co-founder Nolan Bushnell.

What are we going to build?

A two-player game that has two pads (rectangular shapes) at the both ends of the screen, and a Pong object that will be reflected each time it hits one of the pads. Ever time that Pong exceeds the…

--

--