From dd1c0df015cb8720699603d80f56990ce9210f67 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Thu, 24 Jul 2014 11:45:22 -0400 Subject: [PATCH] Small refactor of magic.js --- js/magic.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/magic.js b/js/magic.js index 2a8a5cb..149114c 100644 --- a/js/magic.js +++ b/js/magic.js @@ -88,11 +88,13 @@ window.onload = function () { ax*Math.pow(branch.t, 3) + bx*Math.pow(branch.t, 2) + cx*branch.t + dx, ay*Math.pow(branch.t, 3) + by*Math.pow(branch.t, 2) + cy*branch.t + dy ); + //var step = (branch.t * -0.15) + 0.2; + var step = 0.2; context.lineTo( - ax*Math.pow(branch.t+0.2, 3) + bx*Math.pow(branch.t+0.2, 2) + cx*(branch.t+0.2) + dx, - ay*Math.pow(branch.t+0.2, 3) + by*Math.pow(branch.t+0.2, 2) + cy*(branch.t+0.2) + dy + ax*Math.pow(branch.t+step, 3) + bx*Math.pow(branch.t+step, 2) + cx*(branch.t+step) + dx, + ay*Math.pow(branch.t+step, 3) + by*Math.pow(branch.t+step, 2) + cy*(branch.t+step) + dy ); - branch.t += 0.2; + branch.t += step; } function splitBranch(branch) { @@ -182,7 +184,6 @@ window.onload = function () { } else if (waitTime < 300) { waitTime = waitTime * 1.1; } - console.log(waitTime); lastCast = timeCounter; if (waitTime === 200) {