From 645773b09cb428932911e03ff2d3db432ecb0269 Mon Sep 17 00:00:00 2001 From: Max Stockner Date: Wed, 31 Jul 2013 11:54:18 +0200 Subject: [PATCH] change animation api: set universe when calling run --- anim.js | 5 ++--- test.js | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/anim.js b/anim.js index 237eeaa..ce5efac 100644 --- a/anim.js +++ b/anim.js @@ -1,8 +1,7 @@ var ease = require('./easing.js').ease var resolution = 25; -exports.Anim = function(universe) { - this.universe = universe; +exports.Anim = function() { this.fx_stack = []; this.add = function(to, duration, options) { var options = options || {}; @@ -14,7 +13,7 @@ exports.Anim = function(universe) { this.delay = function(duration) { return this.add({}, duration); } - this.run = function(onFinish) { + this.run = function(universe, onFinish) { var config = {} , t = 0 , d = 0 diff --git a/test.js b/test.js index 265338d..e671a2e 100644 --- a/test.js +++ b/test.js @@ -43,7 +43,7 @@ green_water(universe, [3+15, 6+15, 9+15], 4000); return; -var x = new A(universe) +var x = new A() .add({1: 255, 6: 110, 7: 255, 8: 10}, 1200) .delay(1000) .add({1: 0}, 600) @@ -71,8 +71,8 @@ var x = new A(universe) .delay(200) .add({2: 0}); -var y = new A(universe) +var y = new A() .add({9: 255}, 10000); -x.run(done); -y.run(done); \ No newline at end of file +x.run(universe, done); +y.run(universe, done); \ No newline at end of file