Add: sessionStorage, menu_app
This commit is contained in:
@@ -22,7 +22,18 @@ const GAME_SCREEN_SIZE = { x: 1024, y: 768 }
|
|||||||
let playerName;
|
let playerName;
|
||||||
let playerUserID;
|
let playerUserID;
|
||||||
let bestRecord = 0;
|
let bestRecord = 0;
|
||||||
let playingStageData;
|
|
||||||
|
{
|
||||||
|
playerName = sessionStorage.getItem("playerName");
|
||||||
|
console.log("playerName");
|
||||||
|
console.log(playerName);
|
||||||
|
playerUserID = sessionStorage.getItem("playerUserID");
|
||||||
|
console.log("playerUserID");
|
||||||
|
console.log(playerUserID);
|
||||||
|
bestRecord = sessionStorage.getItem("bestRecord");
|
||||||
|
console.log("bestRecord");
|
||||||
|
console.log(bestRecord);
|
||||||
|
}
|
||||||
|
|
||||||
let textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
|
let textStyleBasic = { font: "bold 32px Arial", fill: "#fff", align: "center", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ var Loading = {
|
|||||||
create: function() {
|
create: function() {
|
||||||
// console.log('Loading');
|
// console.log('Loading');
|
||||||
|
|
||||||
|
let userID = sessionStorage.getItem("UserID");
|
||||||
|
console.log("userID : " + userID);
|
||||||
|
|
||||||
this.game.stage.backgroundColor = '#4d4d4d';
|
this.game.stage.backgroundColor = '#4d4d4d';
|
||||||
|
|
||||||
// Progress report
|
// Progress report
|
||||||
|
|||||||
@@ -124,8 +124,13 @@ let Login = {
|
|||||||
loginSucceeded: function(jsonData) {
|
loginSucceeded: function(jsonData) {
|
||||||
playerUserID = jsonData['UserID'];
|
playerUserID = jsonData['UserID'];
|
||||||
// console.log('playerUserID : ' + playerUserID);
|
// console.log('playerUserID : ' + playerUserID);
|
||||||
|
// this.state.start('Menu');
|
||||||
|
|
||||||
this.state.start('Menu');
|
sessionStorage.setItem("UserID", playerUserID);
|
||||||
|
// let userID = sessionStorage.getItem("UserID");
|
||||||
|
// console.log("userID : " + userID);
|
||||||
|
|
||||||
|
location.href = '../../web/client/menu_app.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
loginFailed: function(jsonData) {
|
loginFailed: function(jsonData) {
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/////////////////////////////
|
||||||
|
// Main game
|
||||||
|
|
||||||
|
const CONTENT_ID = "Menu";
|
||||||
|
|
||||||
|
var game = new Phaser.Game(
|
||||||
|
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
|
||||||
|
Phaser.CANVAS, CONTENT_ID
|
||||||
|
);
|
||||||
|
|
||||||
|
game.state.add('MenuApp', MenuApp);
|
||||||
|
game.state.start('MenuApp');
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Menu
|
// MenuApp
|
||||||
|
|
||||||
var Menu = {
|
var MenuApp = {
|
||||||
|
|
||||||
create: function() {
|
create: function() {
|
||||||
this.stageButtonArray = [];
|
this.stageButtonArray = [];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Login</title>
|
<title>로그인</title>
|
||||||
|
|
||||||
|
|
||||||
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>메뉴</title>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <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>
|
||||||
|
|
||||||
|
<!-- global source files -->
|
||||||
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
|
<script src="../../game/lib/round_rect_button.js"></script>
|
||||||
|
<script src="../../game/global/define_variables_global.js"></script>
|
||||||
|
|
||||||
|
<!-- Space Invaders : source files -->
|
||||||
|
<script src="../../game/menu/menu_app.js"></script>
|
||||||
|
<script src="../../game/menu/main_menu_app.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas{
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="MenuApp" style="text-align:center;" />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user