Here it is...
This commit is contained in:
@@ -159,8 +159,8 @@ TutorialSteps.prototype.nextStep = function() {
|
||||
}
|
||||
|
||||
// Block camera
|
||||
for (var key in camera.motion) {
|
||||
camera.motion[key] = false;
|
||||
for (var key in this.camera.motion) {
|
||||
this.camera.motion[key] = false;
|
||||
}
|
||||
|
||||
Coin.domElement.style.display = "";
|
||||
|
||||
@@ -582,6 +582,8 @@ L3D.PointerCamera.prototype.onKeyEvent = function(event, toSet) {
|
||||
// Log any change
|
||||
var e = new L3D.DB.Event.KeyboardEvent();
|
||||
e.camera = this;
|
||||
e.keypressed = toSet;
|
||||
e.keycode = event.keyCode;
|
||||
e.send();
|
||||
}
|
||||
};
|
||||
@@ -667,6 +669,8 @@ L3D.PointerCamera.prototype.onMouseUp = function(event) {
|
||||
if (this.dragging && this.mouseMoved && !this.moving && !this.movingHermite) {
|
||||
var e = new L3D.DB.Event.KeyboardEvent();
|
||||
e.camera = this;
|
||||
e.keypressed = false;
|
||||
e.keycode = -1;
|
||||
e.send();
|
||||
}
|
||||
|
||||
|
||||
@@ -219,9 +219,17 @@ L3D.generateCoins = function(totalCoins, coin_ids) {
|
||||
|
||||
var i = 0;
|
||||
|
||||
if (coin_ids === undefined)
|
||||
L3D.shuffle(totalCoins);
|
||||
else if (coin_ids === null) {
|
||||
if (coin_ids === undefined) {
|
||||
var tmp = [];
|
||||
// Use global variable coinsId
|
||||
for (i = 0; i < totalCoins.length; i++) {
|
||||
tmp.push(totalCoins[i]);
|
||||
}
|
||||
totalCoins.length = 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
totalCoins.push(tmp[coinsId[i]]);
|
||||
}
|
||||
} else if (coin_ids === null) {
|
||||
return [];
|
||||
} else {
|
||||
|
||||
@@ -247,7 +255,9 @@ L3D.generateCoins = function(totalCoins, coin_ids) {
|
||||
|
||||
var bound = (coin_ids instanceof Array && coin_ids.length === 0) ? totalCoins.length : 8;
|
||||
|
||||
console.log(totalCoins);
|
||||
for (i = 0; i < bound; i++) {
|
||||
console.log(i + '/' + totalCoins.length);
|
||||
coins.push(totalCoins[i].coin);
|
||||
totalCoins[i].coin.id = totalCoins[i].id;
|
||||
indices.push(totalCoins[i].id);
|
||||
|
||||
@@ -158,7 +158,9 @@ L3D.DB.Event.KeyboardEvent.prototype.send = function() {
|
||||
var url = "/posts/keyboard-event";
|
||||
|
||||
var data = {
|
||||
camera: L3D.DB.Private.compactCamera(this.camera)
|
||||
camera: L3D.DB.Private.compactCamera(this.camera),
|
||||
keycode: this.keycode, // -1 represents mouse event
|
||||
keypressed: this.keypressed // mousepressed if keycode === -1
|
||||
};
|
||||
|
||||
L3D.DB.Private.sendData(url, data);
|
||||
|
||||
Reference in New Issue
Block a user