Fix: space invaders game ES5 bug

This commit is contained in:
2018-09-14 22:41:35 +09:00
parent d52279c70d
commit 6568eb5292
2 changed files with 16 additions and 20 deletions
+16 -19
View File
@@ -1,9 +1,6 @@
/////////////////////////////
// Space invaders game
var Game = {
class Game {
create() {
create: function() {
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
sessionStorageManager.setIsNewBestRecord(false);
@@ -79,10 +76,10 @@ class Game {
this.startGame();
// this.countDown();
}
},
initListeners() {
}
initListeners: function() {
},
/*
countDown() {
@@ -115,32 +112,32 @@ class Game {
}
*/
startGame() {
startGame: function() {
// activate first alien
this.alienTimer.start();
}
},
gameOver() {
gameOver: function() {
this.alienTimer.stop();
var gameOverText = new GameOverText();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
}
},
goResult() {
goResult: function() {
location.href = '../../web/client/result.html';
}
},
activateNextAlien() {
activateNextAlien: function() {
this.alienTimer.next();
}
},
getScore() {
getScore: function() {
return (this.alienTimer.activatedAlienIndex) * 2;
}
},
onAlienEscaped() {
onAlienEscaped: function() {
heartManager.breakHearts(1);
}
-1
View File
@@ -32,7 +32,6 @@ var Start = {
this.makeStartButton();
this.makeRankingButton();
console.log(sessionStorageManager.getMaestroAccountType());
if(sessionStorageManager.getMaestroAccountType() >= 100) { // experience account
this.printSampleChart();
this.announceBox = new AnnounceBox(50, 648);