This is the source code for a tutorial on my blog. The tutorial is available here...
- The game canvas
- The game loop
- The special effects (two-dimensional rendering)
- Event listeners
- Collision detection
- Player movement
- NPC movement
- Game Screens
The game is a clone for tutorial purposes and you are welcome to download, fork and modify as you see fit.
Prerequisites and Requirements
To complete the tutorial, all you need is a simple text editor and a browser. I used Visual Studio Code, but any editor will suffice.
The game can run on your browsers
file:// protocol so there are no requirements to host a local server. I used Chrome for the
tutorial I suggest you do the same. The game has not been tested on IE, Safari or Edge.
Play Pong on my website
There is a more complete version of Pong on my website. You can play it here.