MAPG-44 modify game to use pov of place

This commit is contained in:
bence committed 2020-07-04 01:11:04 +02:00
1 parent b736ce8970
commit 3123643bb7
2 files changed
+21 -8

No files matched your search

+7 -4
View File
@@ -8,6 +8,7 @@
rounds: [],
scoreSum: 0,
panoId: null,
pov: null,
panorama: null,
map: null,
guessMarker: null,
@@ -35,6 +36,7 @@
}
Game.panoId = this.response.panoId;
Game.pov = this.response.pov;
if (this.response.history) {
for (var i = 0; i < this.response.history.length; ++i) {
@@ -116,7 +118,7 @@
document.getElementById('currentRound').innerHTML = String(Game.rounds.length) + '/' + String(Game.NUMBER_OF_ROUNDS);
Game.loadPano(Game.panoId);
Game.loadPano(Game.panoId, Game.pov);
},
handleErrorResponse: function (error) {
@@ -129,13 +131,13 @@
});
},
loadPano: function (panoId) {
loadPano: function (panoId, pov) {
if (Game.adaptGuess) {
document.getElementById('guess').classList.add('adapt');
}
Game.panorama.setPov({ heading: 0, pitch: 0 });
Game.panorama.setZoom(0);
Game.panorama.setPov({ heading: pov.heading, pitch: pov.pitch });
Game.panorama.setZoom(pov.zoom);
Game.panorama.setPano(panoId);
},
@@ -199,6 +201,7 @@
}
Game.panoId = this.response.panoId;
Game.pov = this.response.pov;
}, data);
},