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