Add: AppInfoManager
This commit is contained in:
@@ -21,14 +21,17 @@ const GAME_SCREEN_SIZE = { x: 1024, y: 768 }
|
||||
|
||||
let sessingPlayerName;
|
||||
let sessionPlayerUserID;
|
||||
let sessionPlayingAppName;
|
||||
|
||||
{
|
||||
sessionPlayerName = sessionStorage.getItem("playerName");
|
||||
console.log("playerName : " + sessionPlayerName);
|
||||
sessionPlayerUserID = sessionStorage.getItem("playerUserID");
|
||||
console.log("playerUserID : " + sessionPlayerUserID);
|
||||
sessionPlayingAppName = sessionStorage.getItem("playingAppName");
|
||||
console.log("sessionPlayingAppName : " + sessionPlayingAppName);
|
||||
}
|
||||
|
||||
let textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
let appInfoManager = new AppInfoManager();
|
||||
|
||||
let backButtonPosition = { x: 100, y: 70 };
|
||||
let textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||
@@ -0,0 +1,37 @@
|
||||
class AppInfo {
|
||||
|
||||
constructor(name, nameKorean) {
|
||||
this.name = name;
|
||||
|
||||
this.nameKorean = nameKorean;
|
||||
this.isActivated = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class AppInfoManager {
|
||||
|
||||
constructor() {
|
||||
this.appInfoMap = new Map();
|
||||
|
||||
this.registerAppInfoList();
|
||||
}
|
||||
|
||||
registerAppInfoList() {
|
||||
this.registerAppInfo(new AppInfo("login", "로그인"));
|
||||
this.registerAppInfo(new AppInfo("menu", "메뉴"));
|
||||
this.registerAppInfo(new AppInfo("test", "테스트"));
|
||||
this.registerAppInfo(new AppInfo("space_invaders", "외계인 침공"));
|
||||
this.registerAppInfo(new AppInfo("card_matching", "카드 짝 맞추기"));
|
||||
}
|
||||
|
||||
registerAppInfo(appInfo) {
|
||||
this.appInfoMap[appInfo.name] = appInfo;
|
||||
}
|
||||
|
||||
getAppNameKorean(name) {
|
||||
return this.appInfoMap[name].nameKorean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,10 @@ let Login = {
|
||||
create: function() {
|
||||
self = this;
|
||||
|
||||
sessionStorage.removeItem("playerName");
|
||||
sessionStorage.removeItem("playerUserID");
|
||||
sessionStorage.removeItem("playingAppName");
|
||||
|
||||
this.game.stage.backgroundColor = '#4d4d4d';
|
||||
|
||||
// let phaser = game.add.image(game.world.centerX, game.world.centerY, 'phaser');
|
||||
@@ -133,8 +137,10 @@ let Login = {
|
||||
|
||||
sessionStorage.setItem("playerName", sessionPlayerName);
|
||||
sessionStorage.setItem("playerUserID", sessionPlayerUserID);
|
||||
sessionStorage.setItem("playingAppName", "menu");
|
||||
console.log("playerName : " + sessionStorage.getItem("playerName"));
|
||||
console.log("playerUserID : " + sessionStorage.getItem("playerUserID"));
|
||||
console.log("playingAppName : " + sessionStorage.getItem("playingAppName"));
|
||||
|
||||
location.href = '../../web/client/menu_app.html';
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ let MenuApp = {
|
||||
let backButton = new BackButton( () => {
|
||||
sessionStorage.removeItem("playerName");
|
||||
sessionStorage.removeItem("playerUserID");
|
||||
sessionStorage.removeItem("playingAppName");
|
||||
|
||||
location.href = '../../web/client/login.html';
|
||||
});
|
||||
@@ -24,6 +25,9 @@ let MenuApp = {
|
||||
// app icons
|
||||
let space_invaders = new AppButton(AppButton.TYPE_MOUSE, "icon_fullscreen",
|
||||
() => {
|
||||
sessionPlayingAppName = "space_invaders";
|
||||
sessionStorage.setItem("playingAppName", sessionPlayingAppName);
|
||||
|
||||
location.href = '../../web/client/start.html';
|
||||
}
|
||||
);
|
||||
@@ -41,7 +45,7 @@ let MenuApp = {
|
||||
let screenBottom = new ScreenBottom(game);
|
||||
screenBottom.makeBottomLine();
|
||||
// screenBottom.printBottomLeftText("게임 진행 정보");
|
||||
screenBottom.printBottomCenterText("메뉴");
|
||||
screenBottom.printBottomCenterText(appInfoManager.getAppNameKorean(sessionPlayingAppName));
|
||||
screenBottom.printBottomRightText(sessionPlayerName);
|
||||
|
||||
// this.loadTypingStageData();
|
||||
|
||||
@@ -26,7 +26,7 @@ let Start = {
|
||||
let screenBottom = new ScreenBottom(game);
|
||||
screenBottom.makeBottomLine();
|
||||
// screenBottom.printBottomLeftText("게임 진행 정보");
|
||||
screenBottom.printBottomCenterText("Game name");
|
||||
screenBottom.printBottomCenterText(appInfoManager.getAppNameKorean(sessionPlayingAppName));
|
||||
screenBottom.printBottomRightText(sessionPlayerName);
|
||||
|
||||
// this.loadTypingStageData();
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
|
||||
<script src="../../../resources/js/phaser.min.js"></script>
|
||||
|
||||
<!-- global source files -->
|
||||
<script src="../../game/global/define_variables_global.js"></script>
|
||||
<script src="../../game/lib/app_info_manager.js"></script>
|
||||
<script src="../../game/global/global_variables.js"></script>
|
||||
|
||||
<!-- library source files -->
|
||||
<script src="../../game/lib/input_type_text.js"></script>
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
|
||||
<script src="../../../resources/js/phaser.min.js"></script>
|
||||
|
||||
<!-- global source files -->
|
||||
<script src="../../game/global/define_variables_global.js"></script>
|
||||
<script src="../../game/lib/app_info_manager.js"></script>
|
||||
<script src="../../game/global/global_variables.js"></script>
|
||||
|
||||
<!-- library source files -->
|
||||
<script src="../../game/lib/input_type_text.js"></script>
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
|
||||
<script src="../../../resources/js/phaser.min.js"></script>
|
||||
|
||||
<!-- global source files -->
|
||||
<script src="../../game/global/define_variables_global.js"></script>
|
||||
<script src="../../game/global/loading/loading.js"></script>
|
||||
<script src="../../game/lib/app_info_manager.js"></script>
|
||||
<script src="../../game/global/global_variables.js"></script>
|
||||
|
||||
<!-- Space Invaders : source files -->
|
||||
<script src="../../game/mouse/space_invaders/define_variables.js"></script>
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script>
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
|
||||
<script src="../../../resources/js/phaser.min.js"></script>
|
||||
|
||||
<!-- global source files -->
|
||||
<script src="../../game/global/define_variables_global.js"></script>
|
||||
<script src="../../game/lib/app_info_manager.js"></script>
|
||||
<script src="../../game/global/global_variables.js"></script>
|
||||
|
||||
<!-- library source files -->
|
||||
<script src="../../game/lib/input_type_text.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user