(Last Updated on )
One of the many joys of going to Fronteers 2011 (even more than seeing Jake Archibald in a mankini) was Seb Lee-DeLisle’s presentation “CreativeJS – beauty in the browser”. Watching sexy particle systems, using mobile phones as pixels and playing NyanCatch was fun and exciting.
I’m a JavaScipt n00b, but an old hand at programming, which I taught myself in the 80s by coding visual games like space invaders and lunar lander. So when I heard that Seb was giving a two-day workshop in Leeds on how to code creative visual effects and games, I decided to go along.
Seb didn’t start at the very beginning; it’s assumed that we have a text editor, a web inspector (I was using Opera Dragonfly, of course) and that we know what variables and loops are. There wasn’t much talk of prototyping and inheritance either – the emphasis was on the making rather than the theory.
We looked at canvas, how to make simple shapes and simple animations. Then we used Seb’s simple library to add drag, velocity, gravity and randomness to particles, all the while building pretty effects that responded to the mouse. We learned canvas rotations and transforms (which I hadn’t really bellyfelt before) by making a generated tree (which I topped off with random cherry blossom).
We learned how to code the game Asteroids, with a reminder of trigonometry that shocked me: who knew I’d ever need SOHCAHTOA or the Pythagorean theorem in real life? This also helped us learn how to make natural-seeming physics.
We all had a brief foray in webGL, albeit abstracting away most of the horrors via Mr Doob’s THREE.js.