workadventure/front/src/index.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

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";
import {LoginScene} from "./Phaser/Login/LoginScene";
import {ReconnectingScene} from "./Phaser/Reconnecting/ReconnectingScene";
import {gameManager} from "./Phaser/Game/GameManager";
import {SelectCharacterScene} from "./Phaser/Login/SelectCharacterScene";
2020-06-23 12:24:36 +02:00
import {EnableCameraScene} from "./Phaser/Login/EnableCameraScene";
import {FourOFourScene} from "./Phaser/Reconnecting/FourOFourScene";
2020-07-28 11:06:08 +02:00
import {CustomizeScene} from "./Phaser/Login/CustomizeScene";
2020-04-07 20:41:35 +02:00
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: [LoginScene, SelectCharacterScene, EnableCameraScene, ReconnectingScene, FourOFourScene],
zoom: RESOLUTION,
2020-04-11 18:17:36 +02:00
physics: {
default: "arcade",
arcade: {
2020-04-13 19:40:10 +02:00
debug: DEBUG_MODE
}
}
2020-04-03 14:56:21 +02:00
};
2020-04-14 20:04:55 +02:00
cypressAsserter.gameStarted();
2020-06-09 23:13:26 +02:00
const game = new Phaser.Game(config);
window.addEventListener('resize', function (event) {
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
2020-05-13 16:17:58 +02:00
});