partey_workadventure/front/src/index.ts

23 lines
655 B
TypeScript
Raw Normal View History

2020-04-03 14:56:21 +02:00
import 'phaser';
import GameConfig = Phaser.Types.Core.GameConfig;
import {GameScene} from "./Phaser/GameScene";
import {Connexion} from "./Connexion";
import {RESOLUTION} from "./Enum/EnvironmentVariable";
2020-04-03 14:56:21 +02:00
const config: GameConfig = {
title: "Office game",
width: window.innerWidth / RESOLUTION,
height: window.innerHeight / RESOLUTION,
2020-04-03 14:56:21 +02:00
parent: "game",
scene: [GameScene],
zoom: RESOLUTION,
2020-04-03 14:56:21 +02:00
};
let game = new Phaser.Game(config);
window.addEventListener('resize', function (event) {
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
2020-04-04 16:06:38 +02:00
});
const connexion = new Connexion("test@gmail.com");