Fix: start.js ES6 -> ES5
This commit is contained in:
+18
-21
@@ -1,13 +1,10 @@
|
|||||||
/////////////////////////////
|
var Start = {
|
||||||
// Start
|
|
||||||
|
|
||||||
class Start {
|
preload: function() {
|
||||||
|
|
||||||
preload() {
|
|
||||||
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
||||||
}
|
},
|
||||||
|
|
||||||
create() {
|
create: function() {
|
||||||
this.dbConnectManager = new DBConnectManager();
|
this.dbConnectManager = new DBConnectManager();
|
||||||
|
|
||||||
this.game.stage.backgroundColor = '#4d4d4d';
|
this.game.stage.backgroundColor = '#4d4d4d';
|
||||||
@@ -64,9 +61,9 @@ class Start {
|
|||||||
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.getBestRecord());
|
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.getBestRecord());
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
|
||||||
loadHowToPlay(appID) {
|
loadHowToPlay: function(appID) {
|
||||||
this.dbConnectManager.requestHowToPlay(
|
this.dbConnectManager.requestHowToPlay(
|
||||||
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
|
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
|
||||||
(function(jsonData) {
|
(function(jsonData) {
|
||||||
@@ -78,9 +75,9 @@ class Start {
|
|||||||
}).bind(this)
|
}).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
},
|
||||||
|
|
||||||
loadChart() {
|
loadChart: function() {
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
var date = DateUtil.getYYYYMMDD(today);
|
var date = DateUtil.getYYYYMMDD(today);
|
||||||
this.dbConnectManager.requestPlayerHistory(
|
this.dbConnectManager.requestPlayerHistory(
|
||||||
@@ -115,15 +112,15 @@ class Start {
|
|||||||
this.chart.printChartBaseLine();
|
this.chart.printChartBaseLine();
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
|
||||||
calcDate(daysBefore) {
|
calcDate: function(daysBefore) {
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
date.setDate(date.getDate() - daysBefore);
|
date.setDate(date.getDate() - daysBefore);
|
||||||
return date;
|
return date;
|
||||||
}
|
},
|
||||||
|
|
||||||
printSampleChart() {
|
printSampleChart: function() {
|
||||||
var minValue = 0;
|
var minValue = 0;
|
||||||
var maxValue = 1000;
|
var maxValue = 1000;
|
||||||
this.chart.drawRecordGraph(0, this.calcDate(1), 980, minValue, maxValue);
|
this.chart.drawRecordGraph(0, this.calcDate(1), 980, minValue, maxValue);
|
||||||
@@ -135,16 +132,16 @@ class Start {
|
|||||||
this.chart.drawRecordGraph(6, this.calcDate(20), 480, minValue, maxValue);
|
this.chart.drawRecordGraph(6, this.calcDate(20), 480, minValue, maxValue);
|
||||||
|
|
||||||
this.chart.printChartBaseLine();
|
this.chart.printChartBaseLine();
|
||||||
}
|
},
|
||||||
|
|
||||||
makeStartButton() {
|
makeStartButton: function() {
|
||||||
var setting = new RoundRectButtonSetting(game.world.centerX, game.world.centerY, 200, 100);
|
var setting = new RoundRectButtonSetting(game.world.centerX, game.world.centerY, 200, 100);
|
||||||
setting.fontStyle.fontWeight = "bold";
|
setting.fontStyle.fontWeight = "bold";
|
||||||
|
|
||||||
var startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "시작", this.startStage);
|
var startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "시작", this.startStage);
|
||||||
}
|
},
|
||||||
|
|
||||||
makeRankingButton() {
|
makeRankingButton: function() {
|
||||||
var setting = new RoundRectButtonSetting(game.world.centerX + 160, game.world.centerY, 60, 60);
|
var setting = new RoundRectButtonSetting(game.world.centerX + 160, game.world.centerY, 60, 60);
|
||||||
setting.fontStyle = {
|
setting.fontStyle = {
|
||||||
font: "18px Arial",
|
font: "18px Arial",
|
||||||
@@ -161,10 +158,10 @@ class Start {
|
|||||||
);
|
);
|
||||||
if(sessionStorageManager.getMaestroAccountType() == 100)
|
if(sessionStorageManager.getMaestroAccountType() == 100)
|
||||||
rankingButton.inputEnabled = false;
|
rankingButton.inputEnabled = false;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
|
||||||
startStage() {
|
startStage: function() {
|
||||||
if(isTypingPracticeStage())
|
if(isTypingPracticeStage())
|
||||||
location.href = "../../web/client/typing_practice.html";
|
location.href = "../../web/client/typing_practice.html";
|
||||||
else if(isTypingTestStage())
|
else if(isTypingTestStage())
|
||||||
|
|||||||
Reference in New Issue
Block a user