diff --git a/examples/Animated/AnimatedStar.html b/examples/Animated/AnimatedStar.html index 264f6c37..39c9aad5 100644 --- a/examples/Animated/AnimatedStar.html +++ b/examples/Animated/AnimatedStar.html @@ -33,12 +33,10 @@ layer.appendBottom(placedSymbol); } - var count = 0; - function onFrame() { - count++; + function onFrame(event) { for (var i = 0, l = layer.children.length; i < l; i++) { var item = layer.children[i]; - var angle = (values.count - i) * Math.sin(count / 128) / 10; + var angle = (values.count - i) * Math.sin(event.count / 128) / 10; item.rotate(angle); } } diff --git a/examples/Animated/Extruded.html b/examples/Animated/Extruded.html index d008138b..d08bed4d 100644 --- a/examples/Animated/Extruded.html +++ b/examples/Animated/Extruded.html @@ -46,10 +46,9 @@ var length1 = path1.length; var length2 = path2.length; - var count = 0; - function onFrame() { + function onFrame(event) { var vector = new Point({ - angle: -count % 360, + angle: -event.count % 360, length: 100 }); path1.rotate(-0.5); @@ -60,12 +59,11 @@ for (var i = 0; i < lineCount; i++) { var path = lineGroup.children[i]; - var l1 = (length1 / lineCount * (i + count / 10)) % length1; - var l2 = (length2 / lineCount * (i + count / 10)) % length2; + var l1 = (length1 / lineCount * (i + event.count / 10)) % length1; + var l2 = (length2 / lineCount * (i + event.count / 10)) % length2; path.segments[0].point = path1.getPointAt(l1), path.segments[1].point = path2.getPointAt(l2); } - count++; } diff --git a/examples/Animated/Flock.html b/examples/Animated/Flock.html index d7b60150..d898df52 100644 --- a/examples/Animated/Flock.html +++ b/examples/Animated/Flock.html @@ -258,7 +258,6 @@ heartPath.strokeColor = null; heartPath.scale(1.5); - var count = 0; var groupTogether = false; var pathLength = heartPath.length; var mouseDown = false; @@ -270,11 +269,10 @@ boids.push(new Boid(position, 10, 0.05)); } - function onFrame() { - count++; + function onFrame(event) { for (var i = 0, l = boids.length; i < l; i++) { if (groupTogether) { - var point = heartPath.getPointAt(((i + count / 30) % l) / l * pathLength); + var point = heartPath.getPointAt(((i + event.count / 30) % l) / l * pathLength); boids[i].arrive(point); } boids[i].run(boids); diff --git a/examples/Animated/Raster.html b/examples/Animated/Raster.html index 72354f74..d5116d38 100644 --- a/examples/Animated/Raster.html +++ b/examples/Animated/Raster.html @@ -9,11 +9,9 @@