Corrected bug with coins and replay
This commit is contained in:
parent
a0ad86cd19
commit
cceae6af04
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue