- Load game_board only if user is logged in

This commit is contained in:
Administrator 2021-06-08 15:55:33 +02:00
parent 2c7556cbe7
commit af47c15287
2 changed files with 74 additions and 71 deletions

View File

@ -2,12 +2,14 @@ let answer = null;
let show_card = false;
let game = document.getElementById('game');
let app;
let game_board_size = 2000;
let max_size = calculate_size();
let sprite_size = Math.floor(game_board_size / 11);
const app = new PIXI.Application({
function start_game() {
app = new PIXI.Application({
autoResize: true,
resolution: devicePixelRatio,
backgroundAlpha: 0,
@ -93,6 +95,8 @@ let cards_3 = generate_card_stack(PIXI.Sprite.from('/img/card_stack.png'), 7, 3,
});
app.stage.addChild(cards_3);
resize();
}
function generate_card_stack(sprite, x, y, onclick) {
sprite.x = sprite_size * x - sprite_size * 0.2;
@ -137,5 +141,3 @@ function resize() {
app.renderer.resize(size, size)
}
resize();

View File

@ -14,5 +14,6 @@ document.getElementById('ok').addEventListener('click', function () {
document.getElementById('game').style.display = 'flex';
document.getElementById('chat').style.display = 'flex';
start_chat();
start_game();
resize();
});