Fix: ES5 -> ES6 class
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
const CONTENT_ID = "Start";
|
||||
|
||||
var game = new Phaser.Game(
|
||||
let game = new Phaser.Game(
|
||||
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
|
||||
Phaser.CANVAS, CONTENT_ID
|
||||
);
|
||||
|
||||
+19
-19
@@ -1,13 +1,13 @@
|
||||
/////////////////////////////
|
||||
// Start
|
||||
|
||||
let Start = {
|
||||
class Start {
|
||||
|
||||
preload: function() {
|
||||
preload() {
|
||||
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
||||
},
|
||||
}
|
||||
|
||||
create: function() {
|
||||
create() {
|
||||
this.historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
this.game.stage.backgroundColor = '#4d4d4d';
|
||||
@@ -39,25 +39,25 @@ let Start = {
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
|
||||
// this.loadTypingStageData();
|
||||
},
|
||||
}
|
||||
|
||||
printHowToPlay(text) {
|
||||
const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
howToPlayText = game.add.text(0, 0, appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName), style);
|
||||
let howToPlayText = game.add.text(0, 0, appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName), style);
|
||||
howToPlayText.setTextBounds(100, 100, game.world.width - 100, 200);
|
||||
howToPlayText.stroke = "#333";
|
||||
howToPlayText.strokeThickness = 5;
|
||||
},
|
||||
}
|
||||
|
||||
makeStartButton: function() {
|
||||
makeStartButton() {
|
||||
let setting = new RoundRectButtonSetting(200, 100);
|
||||
setting.fontStyle.fontWeight = "bold";
|
||||
|
||||
let startButton = new RoundRectButton(setting, "시작", this.startStage);
|
||||
startButton.move(game.world.centerX, game.world.centerY);
|
||||
},
|
||||
}
|
||||
|
||||
loadHistoryRecords: function() {
|
||||
loadHistoryRecords() {
|
||||
this.historyRecordManager.clear();
|
||||
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/10", 15460));
|
||||
@@ -65,9 +65,9 @@ let Start = {
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/12", 16460));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/13", 15060));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/14", 19800));
|
||||
},
|
||||
}
|
||||
|
||||
printHistoryRecords: function(historyRecords) {
|
||||
printHistoryRecords(historyRecords) {
|
||||
let underValue = this.historyRecordManager.underValueForGraph();
|
||||
let upperValue = this.historyRecordManager.upperValueForGraph();
|
||||
|
||||
@@ -79,9 +79,9 @@ let Start = {
|
||||
this.chartGraphics.lineStyle(3, 0xffd900, 1);
|
||||
this.chartGraphics.moveTo(0, 0);
|
||||
this.chartGraphics.lineTo(game.world.width - 200, 0);
|
||||
},
|
||||
}
|
||||
|
||||
printRecord: function(index, date, record, min, max) {
|
||||
printRecord(index, date, record, min, max) {
|
||||
const CHART_GAP_PX = 180;
|
||||
const style = { font: "32px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
|
||||
@@ -99,10 +99,10 @@ let Start = {
|
||||
this.chartGraphics.lineStyle(50, 0xdddddd, 1);
|
||||
this.chartGraphics.moveTo(50 + index * CHART_GAP_PX, 0);
|
||||
this.chartGraphics.lineTo(50 + index * CHART_GAP_PX, -100 * ( (record - min) / (max - min) ));
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
loadTypingStageData: function() {
|
||||
loadTypingStageData() {
|
||||
var self = this;
|
||||
|
||||
xhr = new XMLHttpRequest();
|
||||
@@ -119,10 +119,10 @@ let Start = {
|
||||
xhr.open('GET', 'activated_stage_list.php', true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send();
|
||||
},
|
||||
}
|
||||
|
||||
startStage: function() {
|
||||
startStage() {
|
||||
location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html";
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user