partey_workadventure/front/src/index.ts

22 lines
622 B
TypeScript
Raw Normal View History

2020-04-03 14:56:21 +02:00
import 'phaser';
import GameConfig = Phaser.Types.Core.GameConfig;
2020-04-07 20:41:35 +02:00
import {GameManager} from "./Phaser/Game/GameManager";
import {RESOLUTION} from "./Enum/EnvironmentVariable";
2020-04-03 14:56:21 +02:00
2020-04-07 20:41:35 +02:00
let gameManager = new GameManager();
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",
2020-04-07 20:41:35 +02:00
scene: gameManager.GameScenes,
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
});