From cceae6af04315698996b985de497c78d08989a85 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Wed, 3 Jun 2015 16:21:11 +0200 Subject: [PATCH] Corrected bug with coins and replay --- js/prototype/ReplayCamera.js | 4 ++-- js/prototype/replay.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/prototype/ReplayCamera.js b/js/prototype/ReplayCamera.js index 5bbf89a..83d029c 100644 --- a/js/prototype/ReplayCamera.js +++ b/js/prototype/ReplayCamera.js @@ -2,7 +2,7 @@ var ReplayCamera = function() { THREE.PerspectiveCamera.apply(this, arguments); - this.cameras = arguments[4]; + this.coins = arguments[4] this.started = false; this.counter = 0; @@ -115,7 +115,7 @@ ReplayCamera.prototype.nextEvent = function() { if (this.event.type == 'camera') { this.move(this.event); } else if (this.event.type == 'coin') { - coins[this.event.id].get(); + this.coins[this.event.id].get(); // Wait a little before launching nextEvent (function(self) { setTimeout(function() { diff --git a/js/prototype/replay.js b/js/prototype/replay.js index aca198d..14cf824 100644 --- a/js/prototype/replay.js +++ b/js/prototype/replay.js @@ -66,7 +66,7 @@ function init() { container.appendChild(renderer.domElement); // Initialize pointer camera - var camera1 = new ReplayCamera(50, container_size.width() / container_size.height(), 0.01, 100000); + var camera1 = new ReplayCamera(50, container_size.width() / container_size.height(), 0.01, 100000, coins); cameras = initBobomb(camera1, scene, static_path, coins); camera1.cameras = cameras;