It doesnโt give you an answer, but itโs interesting that there is a math problem in Chrome
i.currentAngle => 0.0; (deltaTime/1000 * i.rotationSpeed) = 0.025; i.currentAngle + (deltaTime/1000 * i.rotationSpeed) = 2215385637.025;
If you get the individual parts into variables from Update () and in draw () so you can use
var current = i.currentAngle; var delta = (deltaTime/1000 * i.rotationSpeed); ctx.fillText(("angle == " + current+ " delta " + delta),10,50);
you will receive (0,025 and 0) printed
if you then go to
var current = i.currentAngle; var delta = (deltaTime/1000 * i.rotationSpeed); i.currentAngle = current + delta; ctx.fillText(("angle == " + i.currentAngle + " delta " + delta),10,50);
You get crazy great value.
but if you do
var newval = current + delta; ctx.fillText(("angle == " + newval + " delta " + delta),10,50);
then newval has a value of about 0.025, as expected.
Strange if you then follow these
var newval = current + delta; i.currentAngle = newval ctx.fillText(("angle == " + newval + " delta " + delta),10,50);
then newval is now an absolutely crazy value ....
Code Uniquely Nov 16 '13 at 15:46 2013-11-16 15:46
source share