From 6568eb52927fcc4aa4e85eacaa30460e44b3ad0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 14 Sep 2018 22:41:35 +0900 Subject: [PATCH] Fix: space invaders game ES5 bug --- src/game/mouse/space_invaders/game.js | 35 ++++++++++++--------------- src/game/start/start.js | 1 - 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/game/mouse/space_invaders/game.js b/src/game/mouse/space_invaders/game.js index 80dc1fe..af1401d 100644 --- a/src/game/mouse/space_invaders/game.js +++ b/src/game/mouse/space_invaders/game.js @@ -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); } diff --git a/src/game/start/start.js b/src/game/start/start.js index dd3fe05..64d065d 100644 --- a/src/game/start/start.js +++ b/src/game/start/start.js @@ -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);