Permalink
Browse files

Merge pull request #10 from isoden/master

fix bug section-8.3
  • Loading branch information...
2 parents 1077f8e + 26d90fc commit 1c299b9bdc6bc461a3dfcf360d009dea867bb57b @corehtml5canvas committed Dec 5, 2015
Showing with 4 additions and 2 deletions.
  1. +4 −2 ch08/section-8.3/example.js
@@ -367,7 +367,9 @@ canvas.onmousemove = function (e) {
// Animation Loop................................................
-function animate(time) {
+function animate() {
+ var time = Date.now();
+
elapsedTime = (time - launchTime) / 1000;
context.clearRect(0,0,canvas.width,canvas.height);
@@ -423,4 +425,4 @@ bucketImage.onload = function (e) {
bucket.height = BUCKET_HEIGHT;
};
-animate(+new Date());
+animate();

0 comments on commit 1c299b9

Please sign in to comment.