corrected double log of arrow clicked

This commit is contained in:
Thomas FORGIONE 2015-07-03 09:58:44 +02:00
parent 31620de7ff
commit 3c11aba194
2 changed files with 25 additions and 17 deletions

View File

@ -262,10 +262,13 @@ L3D.PointerCamera.prototype.onPointerLockChange = function() {
L3D.PointerCamera.prototype.update = function(time) { L3D.PointerCamera.prototype.update = function(time) {
if (this.moving) { if (this.moving) {
this.linearMotion(time); this.linearMotion(time);
} else if (this.movingHermite) {
this.hermiteMotion(time);
} else { } else {
this.normalMotion(time); this.shouldLogCameraAngles = false;
if (this.movingHermite) {
this.hermiteMotion(time);
} else {
this.normalMotion(time);
}
} }
}; };

View File

@ -115,25 +115,30 @@ L3D.CameraSelecter.prototype.update = function(event, y) {
L3D.CameraSelecter.prototype.click = function(event) { L3D.CameraSelecter.prototype.click = function(event) {
var e; var e;
var newCamera = this.pointedCamera();
if (newCamera !== undefined && !(newCamera instanceof Coin)) { if (this.cameras.mainCamera().pointerLocked === false) {
e = new L3D.BD.Event.ArrowClicked(); var newCamera = this.pointedCamera();
e.arrow_id = this.cameras.cameras.indexOf(newCamera);
e.send();
newCamera.check(); if (newCamera !== undefined && !(newCamera instanceof Coin)) {
this.cameras.mainCamera().moveHermite(newCamera);
buttonManager.updateElements();
} else if (newCamera instanceof Coin) { e = new L3D.BD.Event.ArrowClicked();
e.arrow_id = this.cameras.cameras.indexOf(newCamera);
e.send();
// Coin found, notify server newCamera.check();
e = new L3D.BD.Event.CoinClicked(); this.cameras.mainCamera().moveHermite(newCamera);
e.coin_id = this.coins.indexOf(newCamera); buttonManager.updateElements();
e.send();
newCamera.get(); } else if (newCamera instanceof Coin) {
// Coin found, notify server
e = new L3D.BD.Event.CoinClicked();
e.coin_id = this.coins.indexOf(newCamera);
e.send();
newCamera.get();
}
} }