Small refactor of magic.js

This commit is contained in:
Tyler Hallada 2014-07-24 11:45:22 -04:00
parent c09951dcf2
commit dd1c0df015

View File

@ -88,11 +88,13 @@ window.onload = function () {
ax*Math.pow(branch.t, 3) + bx*Math.pow(branch.t, 2) + cx*branch.t + dx, 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 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( context.lineTo(
ax*Math.pow(branch.t+0.2, 3) + bx*Math.pow(branch.t+0.2, 2) + cx*(branch.t+0.2) + dx, ax*Math.pow(branch.t+step, 3) + bx*Math.pow(branch.t+step, 2) + cx*(branch.t+step) + dx,
ay*Math.pow(branch.t+0.2, 3) + by*Math.pow(branch.t+0.2, 2) + cy*(branch.t+0.2) + dy 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) { function splitBranch(branch) {
@ -182,7 +184,6 @@ window.onload = function () {
} else if (waitTime < 300) { } else if (waitTime < 300) {
waitTime = waitTime * 1.1; waitTime = waitTime * 1.1;
} }
console.log(waitTime);
lastCast = timeCounter; lastCast = timeCounter;
if (waitTime === 200) { if (waitTime === 200) {