2020-04-03 14:56:21 +02:00
|
|
|
import 'phaser';
|
|
|
|
import GameConfig = Phaser.Types.Core.GameConfig;
|
2020-04-13 19:40:10 +02:00
|
|
|
import {DEBUG_MODE, RESOLUTION} from "./Enum/EnvironmentVariable";
|
2020-04-14 20:04:55 +02:00
|
|
|
import {cypressAsserter} from "./Cypress/CypressAsserter";
|
2020-04-26 17:54:56 +02:00
|
|
|
import {LogincScene} from "./Phaser/Login/LogincScene";
|
2020-04-27 15:03:05 +02:00
|
|
|
import {GameScene} from "./Phaser/Game/GameScene";
|
2020-04-07 20:41:35 +02:00
|
|
|
|
2020-04-03 14:56:21 +02:00
|
|
|
const config: GameConfig = {
|
|
|
|
title: "Office game",
|
2020-04-06 22:55:09 +02:00
|
|
|
width: window.innerWidth / RESOLUTION,
|
|
|
|
height: window.innerHeight / RESOLUTION,
|
2020-04-03 14:56:21 +02:00
|
|
|
parent: "game",
|
2020-04-27 15:03:05 +02:00
|
|
|
scene: [LogincScene, GameScene],
|
2020-04-06 22:55:09 +02:00
|
|
|
zoom: RESOLUTION,
|
2020-04-11 18:17:36 +02:00
|
|
|
physics: {
|
2020-04-12 16:12:08 +02:00
|
|
|
default: "arcade",
|
|
|
|
arcade: {
|
2020-04-13 19:40:10 +02:00
|
|
|
debug: DEBUG_MODE
|
2020-04-12 16:12:08 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-03 14:56:21 +02:00
|
|
|
};
|
|
|
|
|
2020-04-14 20:04:55 +02:00
|
|
|
cypressAsserter.gameStarted();
|
|
|
|
|
2020-04-26 17:54:56 +02:00
|
|
|
let game = new Phaser.Game(config);
|
2020-04-03 18:41:06 +02:00
|
|
|
|
2020-04-26 17:54:56 +02:00
|
|
|
window.addEventListener('resize', function (event) {
|
|
|
|
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
|
|
|
|
});
|