summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2021-02-17 09:18:10 -0600
committerColin Okay <okay@toyful.space>2021-02-17 09:18:10 -0600
commit7b99a7925cc27160a8a0114d87d413f8bac15991 (patch)
treec1e0f65483603123162deeab0bddab4c2044b349
parent724e3e3aa41ecf916721e2065e7c8120785e8c40 (diff)
fiddling with fade timing
-rw-r--r--Source/Main.hx11
1 files changed, 6 insertions, 5 deletions
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);
}
}