Add: start (page)

This commit is contained in:
2018-05-09 07:19:03 +09:00
parent 5cecf98858
commit 024e114077
6 changed files with 135 additions and 16 deletions
+69
View File
@@ -0,0 +1,69 @@
/////////////////////////////
// Start
let Start = {
preload: function() {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
},
create: function() {
this.game.stage.backgroundColor = '#4d4d4d';
// top
let backButton = new BackButton( () => {
location.href = '../../web/client/menu_app.html';
});
let fullscreenButton = new FullscreenButton(this.game);
// contents
this.makeStartButton();
// bottom
let screenBottom = new ScreenBottom(game);
screenBottom.makeBottomLine();
// screenBottom.printBottomLeftText("게임 진행 정보");
screenBottom.printBottomCenterText("Game name");
screenBottom.printBottomRightText(sessionPlayerName);
// this.loadTypingStageData();
},
makeStartButton: function() {
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);
},
loadTypingStageData: function() {
var self = this;
xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
// console.log("onreadystatechange : " + xhr);
// console.log("xhr.readyState : " + xhr.readyState);
// console.log("xhr.status : " + xhr.status);
if(xhr.readyState == 4 && xhr.status == 200) {
// console.log(xhr.responseText);
var jsonData = JSON.parse(xhr.responseText);
self.updateStageButton(jsonData);
}
}
xhr.open('GET', 'activated_stage_list.php', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send();
},
startStage: function() {
console.log("startStage");
// this.startState('TypingTestStage');
},
}