From b379187f4fa604ee43c15fac15f786a14c15d0e6 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 8 May 2014 23:13:27 +0200 Subject: [PATCH] Tweaks --- compiled/radium.js | 3 +-- gemswap/core.coffee | 4 ++-- gemswap/gemswap.js | 2 +- radium/engine.coffee | 4 +++- radium/engine.ease.coffee | 4 +--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compiled/radium.js b/compiled/radium.js index 93fd714..0615e88 100644 --- a/compiled/radium.js +++ b/compiled/radium.js @@ -708,11 +708,9 @@ this.value = this.start; this.last_updated = this.start_frame; this.finished = false; - console.log(this); } Ease.prototype.goToNext = function() { - console.log("next", this.next); this.func = this[this.next.type]; this.change = this.next.change; this.value = this.next.value; @@ -722,6 +720,7 @@ this.change = this.next.change; this.invert_repeat = this.next.invert_repeat; this.params = this.next.params; + this.duration = this.next.duration; this.finished = false; return this.next = this.next.next; }; diff --git a/gemswap/core.coffee b/gemswap/core.coffee index d745b7f..a00385c 100644 --- a/gemswap/core.coffee +++ b/gemswap/core.coffee @@ -115,7 +115,7 @@ $(-> diamond.onMouseOver = -> #@fade_decay_current = 1 - @fade_value = @engine.ease.circOut(0, 1, 30, @engine.ease.bounceOut(1, 0, 45)) + @fade_value = @engine.ease.circOut(0, 1, 10, @engine.ease.bounceOut(1, 0, 35)) cursor = @engine.getObject("cursor").getInstances()[0] cursor.x = @x - 9 @@ -132,4 +132,4 @@ $(-> engine.start() ) -) \ No newline at end of file +) diff --git a/gemswap/gemswap.js b/gemswap/gemswap.js index 675cc72..9fbc1f6 100644 --- a/gemswap/gemswap.js +++ b/gemswap/gemswap.js @@ -93,7 +93,7 @@ }); }; diamond.onMouseOver = function() { - this.fade_value = this.engine.ease.circOut(0, 1, 30, this.engine.ease.bounceOut(1, 0, 45)); + this.fade_value = this.engine.ease.circOut(0, 1, 10, this.engine.ease.bounceOut(1, 0, 35)); cursor = this.engine.getObject("cursor").getInstances()[0]; cursor.x = this.x - 9; return cursor.y = this.y - 9; diff --git a/radium/engine.coffee b/radium/engine.coffee index eac7feb..d9c5703 100644 --- a/radium/engine.coffee +++ b/radium/engine.coffee @@ -18,6 +18,8 @@ class Engine @unnamed_timers = [] # The following is to make the engine object available in library methods + # FUTURE: Iterate over easing methods and create an engine-bound version + # in the local engine object, overriding the prototype methods? @ease.engine = this addCanvas: (canvas, label = "") => @@ -132,4 +134,4 @@ class Engine if typeof name == "string" then @sprites[name] else name getTileset: (name) => - if typeof name == "string" then @tilesets[name] else name \ No newline at end of file + if typeof name == "string" then @tilesets[name] else name diff --git a/radium/engine.ease.coffee b/radium/engine.ease.coffee index df94210..6a3764b 100644 --- a/radium/engine.ease.coffee +++ b/radium/engine.ease.coffee @@ -93,7 +93,6 @@ class Ease @value = @start @last_updated = @start_frame @finished = false - console.log(this) # TODO: Investigate whether JS engines cache deterministic outcomes by themselves. If not, # the below could provide some performance gain. #@bounce_constant_1 = 1 / 2.75 @@ -101,7 +100,6 @@ class Ease #@bounce_constant_3 = 2.5 / 2.75 goToNext: => - console.log("next", @next) @func = this[@next.type] @change = @next.change @value = @next.value @@ -111,6 +109,7 @@ class Ease @change = @next.change @invert_repeat = @next.invert_repeat @params = @next.params + @duration = @next.duration @finished = false @next = @next.next @@ -195,4 +194,3 @@ class Ease else time = time - 2 return @change / 2 * (Math.sqrt(1 - time * time) + 1) + @begin - \ No newline at end of file