Add: prepare html and basic js files

This commit is contained in:
2019-01-02 22:34:28 +09:00
parent 9238d4daa7
commit 7434a43fd0
7 changed files with 382 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
var WordFlyingSaucer = {
create: function() {
this.dbConnectManager = new DBConnectManager();
sessionStorageManager.setRecord(0);
sessionStorageManager.setIsNewAppHighestRecord(false);
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
(function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
// top ui
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
screenTopUI.makeFullScreenButton();
this.scoreManager = new ScoreManager();
this.scoreBoard = new ScoreBoard();
this.scoreManager.addOnChangeScoreListener(
(function(score) {
sessionStorageManager.setRecord(score);
this.scoreBoard.printScore(NumberUtil.numberWithCommas(score));
}).bind(this)
);
this.scoreManager.addOnChangeHighScoreListener(
(function(highScore) {
console.log(highScore);
// sessionStorageManager.setAppHighestRecord(highScore);
sessionStorageManager.setIsNewBestRecrd(true);
// this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
}).bind(this)
);
var heartManager = new HeartManager();
var heartGauge = new HeartGauge(heartManager);
heartManager.addOnChangeGameOverListener(
(function() { this.gameOver(); }).bind(this)
);
heartGauge.start();
// bottom ui
this.screenBottomUI = new ScreenBottomUI();
// screenBottomUI.printBottomUILeftText("");
this.screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
// this.startGame();
},
back: function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
},
startGame: function() {
},
timeOver: function() {
var timeOverText = new TimeOverText();
sessionStorageManager.setRecord(this.scoreManager.getScore());
if(!isExperienceMaestroAccount())
this.updateResultRecord();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
updateResultRecord: function() {
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
this.dbConnectManager.updateResultRecord(
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(),
sessionStorageManager.getRecord()
);
}
},
goResult: function() {
location.href = '../../web/client/result.html';
},
}