Fix to move the camera only in the map. The camera stops on the border map.

This commit is contained in:
gparant 2020-04-06 22:55:09 +02:00
parent 8c3d62496b
commit ddc39d6e50
3 changed files with 39 additions and 18 deletions

View file

@ -2,22 +2,21 @@ import 'phaser';
import GameConfig = Phaser.Types.Core.GameConfig;
import {GameScene} from "./GameScene";
import {Connexion} from "./Connexion";
const resolution = 2;
import {RESOLUTION} from "./Enum/EnvironmentVariable";
const config: GameConfig = {
title: "Office game",
width: window.innerWidth / resolution,
height: window.innerHeight / resolution,
width: window.innerWidth / RESOLUTION,
height: window.innerHeight / RESOLUTION,
parent: "game",
scene: [GameScene],
zoom: resolution,
zoom: RESOLUTION,
};
let game = new Phaser.Game(config);
window.addEventListener('resize', function (event) {
game.scale.resize(window.innerWidth / resolution, window.innerHeight / resolution);
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
});
const connexion = new Connexion("test@gmail.com");