As part of my slow, very slow, progress towards learning how to program with javascript, I made a pong game.

It is here (opens in a new window)

I created it using the tutorial on Codeheir.com which is very easy to follow and does a good job of explaining what each bit of code does and why it works. What I am learning to love about javascript is that you don’t need many lines of code to make something very tangible. Admittedly that is mostly due to the use of the p5 library, but that is entirely the point – libraries do a lot of the heavy lifting for you.

Like all good tutorials, it leaves some unfinished business – i.e. how can the student develop the game further to iron out the kinks and add some features.

Here is my wishlist for version 1.1:

  1. Add some variation to the ball direction when it hits the paddle, e.g. when it hits the corner of the paddle
  2. Add a target score and winner
  3. Make scoring a bigger deal graphically
  4. (Maybe) make the ball square (I think it was square in the original game in the 1970’s)
  5. Increase the ball speed if there is a long rally

Which might get done over Christmas. And might not.

Leave a Reply

Your email address will not be published. Required fields are marked *