After I finished Wavy Waves, some work was left to do to reduce its size, fitting into JS1K contest’s 1024 bytes limit. To achieve this incredible size I used Google’s Closure Compiller and the code got reduced...
Ok, after submitting this script, will be nice if I explain how the Wavy Waves Mesmerizer works… Lets start from the beginning: the global variables.
var doc = document;
var canvas = doc.getElementById( ‘c’ );
var context = canvas.getContext( ‘2d’ );
var width = canvas.width = window.innerWidth - 21;
var height = canvas.height = window.innerHeight - 21;
var max_particles = width * height / 810;
var particles = ;
var math = Math;
var rnd = math.random;
var max = math.max;
var min = math.min;
var i = 0;
var functions = [‘sin’,’cos’,’tan’];
var fnx = math[‘sin’];
var fny = math[‘sin’];
The code above declares everything that will be...