Saturday, February 14, 2015

Gorgeous vanilla javascript to make a simple Pong using only canvas

I've been thinking about getting into vanilla javascript and specifically into the canvas element.  You can read through tutorials and so on, but nothing is nicer for something like this than seeing good code.  It's even better if it's simple.

So tonight I felt extremely lucky to happen upon this:

Ben Shepherd did a screencast of himself coding up a very simple pong using Javascript canvas here (check out the music on this video too):

https://www.youtube.com/watch?v=ITmH-W49Mvk

But, even better he posted the code.  It's beautiful, with good patterns, and it's extremely easy to understand.  Wow.

Here's the code (and, since this is JS, it's a working Pong):

 http://passion4web.co.uk/ben/pong.html

No comments:

Post a Comment