Skip to content

Instantly share code, notes, and snippets.

@Nek
Forked from anonymous/water.js
Created July 18, 2012 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nek/3135008 to your computer and use it in GitHub Desktop.
Save Nek/3135008 to your computer and use it in GitHub Desktop.
created for livecoding - http://livecoding.gabrielflor.it
$.ajaxSetup({
cache: true
});
var s1 = $.getScript('https://raw.github.com/Animatron/player/master/vendor/matrix.js');
var s2 = $.getScript('https://raw.github.com/Animatron/player/master/anm.player.js');
var s3 = $.getScript('https://raw.github.com/Animatron/player/master/anm.builder.js');
//var s4 = $.getScript('https://raw.github.com/Animatron/player/master/anm.collisions.js');
$.when( s1, s2, s3 ).then(function() {
//ensure that canvas is created only once, 'cause the DOM is persistent
var d = $("#display");
var canv = d.find("canvas");
if (canv.length === 0) canv = $("<canvas id='test' width='300' height='300'/>").appendTo(d);
var b = Builder._$;
createPlayer('test').load(
b().rect([22, 20], 10).move([100, 100])
).play();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment