Commit 7affd41c authored by 18신대성's avatar 18신대성

ESC로 로그아웃 구현

parent 88609700
......@@ -2,6 +2,8 @@ function FirebaseClient()
{
this.init();
this.initEvent();
this.isGameStarted = false;
}
FirebaseClient.prototype.init = function()
......@@ -69,6 +71,7 @@ FirebaseClient.prototype.setLogin = function()
.then(function()
{
game = new Phaser.Game(config);
fbClient.isGameStarted = true;
});
document.getElementById('mainTitle').style.display = 'none';
......@@ -77,7 +80,10 @@ FirebaseClient.prototype.setLogin = function()
FirebaseClient.prototype.setLogOut = function()
{
if (game != null) game.destroy(true);
this.isGameStarted = false;
document.getElementById('mainTitle').style.display = 'block';
document.getElementById('titleImg').style.display = 'block';
}
FirebaseClient.prototype.onEmailBtnClick = function()
......@@ -239,6 +245,11 @@ document.addEventListener('DOMContentLoaded', function()
console.log('done load');
});
document.onkeydown = function(e)
{
if (fbClient.isGameStarted && e.keyCode === 27) fbClient.logOut();
}
class UserData
{
constructor()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment