From 7b99a7925cc27160a8a0114d87d413f8bac15991 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 17 Feb 2021 09:18:10 -0600 Subject: fiddling with fade timing --- Source/Main.hx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Source/Main.hx') diff --git a/Source/Main.hx b/Source/Main.hx index 0160001..fef3377 100644 --- a/Source/Main.hx +++ b/Source/Main.hx @@ -431,6 +431,8 @@ class Wiggler extends Sprite graphics.clear(); var stamp = haxe.Timer.stamp(); + var fade1 = Math.cos(this.fadeSpeed * stamp); + var fade2 = Math.sin(this.fadeSpeed * stamp); // redner path if (renderPhases.contains( Border)) @@ -441,21 +443,20 @@ class Wiggler extends Sprite graphicsPath.lineTo( path[i].x, path[i].y); graphics.beginFill( this.color); - graphics.lineStyle(this.offset * (0.5 + Math.cos( this.fadeSpeed * stamp)), - this.borderColor); + graphics.lineStyle(1 + this.offset * (1 + fade1), this.borderColor); graphicsPath.lineTo( path[0].x, path[0].y); graphics.drawPath( graphicsPath.commands, graphicsPath.data ); } if (renderPhases.contains( Circles )) { - graphics.lineStyle(Math.random() * this.offset, + graphics.lineStyle( this.offset, this.borderColor, - Math.cos(stamp + this.offset)); + fade1); for (circ in circles) if (circ.visible) { - graphics.beginFill( circ.color, 1 + 0.5 * Math.sin(stamp * fadeSpeed * 0.5)); + graphics.beginFill( circ.color, 0.5 + 0.5 * (1 + fade2)); graphics.drawCircle( circ.x, circ.y, circ.radius); } } -- cgit v1.2.3