OUR EXPERT
Matt Holder was told he wasted far too much of his youth playing Pong – but it turns out it was all in the name of research.
We can’t imagine there are many folk who need introducing to Pong. However, for those who do, it is a two-player game in which table tennis (or ping pong) is simulated.
Pong was an early computer game, first released in 1972. Upright arcade cabinet machines existed that ran the game as well as home consoles that became available from 1975 onwards. Pong was first released by Atari and there have been many versions created over the years, both ones that use hardware and versions using various programming languages that run on top of your operating system.
In this article, we are creating a basic Pong game and the full code is available on GitHub (see Quick Tip, left). We cover a number of concepts including the event loop, how to use keyboard control and how to use variables to store each player’s score. Before we begin coding, let’s quickly discuss the gameplay. A paddle is drawn on the left- and right-hand sides of the screen. Each player controls the vertical