Fix: ES6 -> ES5 (imcompleted)

This commit is contained in:
2018-09-14 11:15:24 +09:00
parent bccee696d4
commit 1a2d9e6800
15 changed files with 832 additions and 819 deletions
+16 -18
View File
@@ -4,21 +4,19 @@
class Game {
create() {
let self = this;
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
sessionStorageManager.isNewBestRecrd = false;
// top ui
let screenTopUI = new ScreenTopUI();
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
let scoreBoard = new ScoreBoard();
var scoreBoard = new ScoreBoard();
scoreManager.addOnChangeScoreListener( function(score) {
sessionStorageManager.record = score;
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
@@ -30,19 +28,19 @@ class Game {
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
});
let heartGauge = new HeartGauge(heartManager);
var heartGauge = new HeartGauge(heartManager);
heartManager.addOnChangeGameOverListener(
function() { self.gameOver(); }
(function() { this.gameOver(); }).bind(this)
);
heartGauge.start();
// game stage
let stars = game.add.group();
var stars = game.add.group();
for (let i = 0; i < 128; i++)
for (var i = 0; i < 128; i++)
{
let randomY = game.rnd.integerInRange(60, GAME_SCREEN_SIZE.y - 80);
var randomY = game.rnd.integerInRange(60, GAME_SCREEN_SIZE.y - 80);
stars.create(game.world.randomX, randomY, 'star');
}
@@ -55,13 +53,13 @@ class Game {
// contents
this.aliens = [];
for(let i = 0; i < 10; i++) {
let alien = new Alien(150 + 80 * i, 150,
(function() { self.activateNextAlien(); }), // onGoOnstage
for(var i = 0; i < 10; i++) {
var alien = new Alien(150 + 80 * i, 150,
(function() { this.activateNextAlien(); }).bind(this), // onGoOnstage
(function(sprite) {
scoreManager.plusScore(self.getScore());
let scoreText = new ScoreText(sprite.x, sprite.y, self.getScore());
}), // this.onAlienFired,
scoreManager.plusScore(this.getScore());
var scoreText = new ScoreText(sprite.x, sprite.y, this.getScore());
}).bind(this), // this.onAlienFired,
this.onAlienEscaped
);
alien.goWaitingRoom();
@@ -73,7 +71,7 @@ class Game {
// bottom ui
let screenBottomUI = new ScreenBottomUI();
var screenBottomUI = new ScreenBottomUI();
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
screenBottomUI.printCenterText(sessionStorageManager.playingAppKoreanName);
screenBottomUI.printRightText(sessionStorageManager.playerName);
@@ -109,7 +107,7 @@ class Game {
this.countDownText.text = this.countDownNumber.toString();
this.countDownText.alpha = 1;
let countDownTween = game.add.tween(this.countDownText);
var countDownTween = game.add.tween(this.countDownText);
countDownTween.to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
countDownTween.onComplete.add(this.tweenCountDown, this);
@@ -125,7 +123,7 @@ class Game {
gameOver() {
this.alienTimer.stop();
let gameOverText = new GameOverText();
var gameOverText = new GameOverText();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
}