da0d9fed87
Taking what was done in the LoginScene regarding character selection and putting it in its own scene. Also, making character selection possible via the keyboard.
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import 'phaser';
|
|
import GameConfig = Phaser.Types.Core.GameConfig;
|
|
import {DEBUG_MODE, RESOLUTION} from "./Enum/EnvironmentVariable";
|
|
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";
|
|
|
|
const config: GameConfig = {
|
|
title: "Office game",
|
|
width: window.innerWidth / RESOLUTION,
|
|
height: window.innerHeight / RESOLUTION,
|
|
parent: "game",
|
|
scene: [SelectCharacterScene, LoginScene, ReconnectingScene],
|
|
zoom: RESOLUTION,
|
|
physics: {
|
|
default: "arcade",
|
|
arcade: {
|
|
debug: DEBUG_MODE
|
|
}
|
|
}
|
|
};
|
|
|
|
cypressAsserter.gameStarted();
|
|
|
|
let game = new Phaser.Game(config);
|
|
|
|
window.addEventListener('resize', function (event) {
|
|
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
|
|
});
|