created a login screen
This commit is contained in:
parent
f3fdcba16a
commit
61c6b9dacb
BIN
front/dist/resources/objects/play_button.png
vendored
Normal file
BIN
front/dist/resources/objects/play_button.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 969 B |
|
@ -1,4 +1,4 @@
|
||||||
import {GameManagerInterface} from "./Phaser/Game/GameManager";
|
import {gameManager, GameManagerInterface} from "./Phaser/Game/GameManager";
|
||||||
|
|
||||||
const SocketIo = require('socket.io-client');
|
const SocketIo = require('socket.io-client');
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
|
@ -105,54 +105,43 @@ export interface ConnexionInterface {
|
||||||
email : string;
|
email : string;
|
||||||
userId: string;
|
userId: string;
|
||||||
startedRoom : string;
|
startedRoom : string;
|
||||||
createConnexion() : Promise<any>;
|
createConnexion(userName:string, email: string) : Promise<any>;
|
||||||
joinARoom(roomId : string) : void;
|
joinARoom(roomId : string) : void;
|
||||||
sharePosition(roomId : string, x : number, y : number, direction : string) : void;
|
sharePosition(roomId : string, x : number, y : number, direction : string) : void;
|
||||||
positionOfAllUser() : void;
|
positionOfAllUser() : void;
|
||||||
}
|
}
|
||||||
export class Connexion implements ConnexionInterface{
|
export class ConnexionManager implements ConnexionInterface{
|
||||||
socket : any;
|
socket : any;
|
||||||
token : string;
|
token : string;
|
||||||
email : string;
|
email : string;
|
||||||
userId: string;
|
userId: string;
|
||||||
startedRoom : string;
|
startedRoom : string;
|
||||||
|
|
||||||
GameManager: GameManagerInterface;
|
shareUserPositionCallback: Function;
|
||||||
|
|
||||||
|
|
||||||
constructor(email : string, GameManager: GameManagerInterface) {
|
constructor() {
|
||||||
this.email = email;
|
|
||||||
this.GameManager = GameManager;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
createConnexion() : Promise<ConnexionInterface>{
|
async createConnexion(email : string) : Promise<ConnexionInterface>{
|
||||||
return Axios.post(`${API_URL}/login`, {email: this.email})
|
let res = await Axios.post(`${API_URL}/login`, {email});
|
||||||
.then((res) => {
|
this.token = res.data.token;
|
||||||
this.token = res.data.token;
|
this.startedRoom = res.data.roomId;
|
||||||
this.startedRoom = res.data.roomId;
|
this.userId = res.data.userId;
|
||||||
this.userId = res.data.userId;
|
|
||||||
|
|
||||||
this.socket = SocketIo(`${API_URL}`, {
|
this.socket = SocketIo(`${API_URL}`, {
|
||||||
query: {
|
query: {
|
||||||
token: this.token
|
token: this.token
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//join the room
|
//join the room
|
||||||
this.joinARoom(this.startedRoom);
|
this.joinARoom(this.startedRoom);
|
||||||
|
//share your first position
|
||||||
//share your first position
|
this.sharePosition(this.startedRoom, 0, 0);
|
||||||
this.sharePosition(this.startedRoom, 0, 0);
|
this.positionOfAllUser();
|
||||||
|
this.errorMessage();
|
||||||
this.positionOfAllUser();
|
return this;
|
||||||
|
|
||||||
this.errorMessage();
|
|
||||||
|
|
||||||
return this;
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +188,9 @@ export class Connexion implements ConnexionInterface{
|
||||||
let dataList = JSON.parse(message);
|
let dataList = JSON.parse(message);
|
||||||
dataList.forEach((UserPositions: any) => {
|
dataList.forEach((UserPositions: any) => {
|
||||||
let listMessageUserPosition = new ListMessageUserPosition(UserPositions[0], UserPositions[1]);
|
let listMessageUserPosition = new ListMessageUserPosition(UserPositions[0], UserPositions[1]);
|
||||||
this.GameManager.shareUserPosition(listMessageUserPosition);
|
if (this.shareUserPositionCallback) {
|
||||||
|
this.shareUserPositionCallback(listMessageUserPosition)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -209,4 +200,10 @@ export class Connexion implements ConnexionInterface{
|
||||||
console.error("message-error", message);
|
console.error("message-error", message);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
registerShareUserPositionCallback(callback: (l:ListMessageUserPosition) => {}) {
|
||||||
|
this.shareUserPositionCallback = callback;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const connectionManager = new ConnexionManager();
|
|
@ -1,6 +1,10 @@
|
||||||
import {GameSceneInterface, GameScene} from "./GameScene";
|
import {GameSceneInterface, GameScene} from "./GameScene";
|
||||||
import {ROOM} from "../../Enum/EnvironmentVariable"
|
import {ROOM} from "../../Enum/EnvironmentVariable"
|
||||||
import {Connexion, ConnexionInterface, ListMessageUserPositionInterface} from "../../Connexion";
|
import {
|
||||||
|
ConnexionInterface,
|
||||||
|
ListMessageUserPositionInterface,
|
||||||
|
connectionManager
|
||||||
|
} from "../../ConnexionManager";
|
||||||
|
|
||||||
export enum StatusGameManagerEnum {
|
export enum StatusGameManagerEnum {
|
||||||
IN_PROGRESS = 1,
|
IN_PROGRESS = 1,
|
||||||
|
@ -21,36 +25,12 @@ export class GameManager implements GameManagerInterface {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.status = StatusGameManagerEnum.IN_PROGRESS;
|
this.status = StatusGameManagerEnum.IN_PROGRESS;
|
||||||
ConnexionInstance = new Connexion("test@gmail.com", this);
|
|
||||||
}
|
|
||||||
|
|
||||||
createGame(){
|
|
||||||
return ConnexionInstance.createConnexion().then(() => {
|
|
||||||
this.configureGame();
|
|
||||||
/** TODO add loader in the page **/
|
|
||||||
}).catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* permit to config rooms
|
|
||||||
*/
|
|
||||||
configureGame() {
|
|
||||||
ROOM.forEach((roomId) => {
|
|
||||||
let newGame = new GameScene(roomId, this);
|
|
||||||
this.GameScenes.push((newGame as GameSceneInterface));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permit to create player in started room
|
* Permit to create player in started room
|
||||||
*/
|
*/
|
||||||
createCurrentPlayer(): void {
|
createCurrentPlayer(): void {
|
||||||
//Get started room send by the backend
|
|
||||||
let game: GameSceneInterface = this.GameScenes.find((Game: GameSceneInterface) => Game.RoomId === ConnexionInstance.startedRoom);
|
|
||||||
game.createCurrentPlayer(ConnexionInstance.userId);
|
|
||||||
this.status = StatusGameManagerEnum.CURRENT_USER_CREATED;
|
this.status = StatusGameManagerEnum.CURRENT_USER_CREATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,4 +52,6 @@ export class GameManager implements GameManagerInterface {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const gameManager = new GameManager();
|
|
@ -1,13 +1,14 @@
|
||||||
import {GameManagerInterface, StatusGameManagerEnum} from "./GameManager";
|
import {gameManager, GameManagerInterface, StatusGameManagerEnum} from "./GameManager";
|
||||||
import {MessageUserPositionInterface} from "../../Connexion";
|
import {connectionManager, MessageUserPositionInterface} from "../../ConnexionManager";
|
||||||
import {CurrentGamerInterface, GamerInterface, Player} from "../Player/Player";
|
import {CurrentGamerInterface, GamerInterface, Player} from "../Player/Player";
|
||||||
import {DEBUG_MODE, RESOLUTION, ZOOM_LEVEL} from "../../Enum/EnvironmentVariable";
|
import {DEBUG_MODE, RESOLUTION, ZOOM_LEVEL} from "../../Enum/EnvironmentVariable";
|
||||||
import Tile = Phaser.Tilemaps.Tile;
|
import Tile = Phaser.Tilemaps.Tile;
|
||||||
import {ITiledMap, ITiledTileSet} from "../Map/ITiledMap";
|
import {ITiledMap, ITiledTileSet} from "../Map/ITiledMap";
|
||||||
import {cypressAsserter} from "../../Cypress/CypressAsserter";
|
import {cypressAsserter} from "../../Cypress/CypressAsserter";
|
||||||
|
import {NonPlayer} from "../NonPlayer/NonPlayer";
|
||||||
|
|
||||||
|
export const GameSceneName = "GameScene";
|
||||||
export enum Textures {
|
export enum Textures {
|
||||||
Rock = 'rock',
|
|
||||||
Player = 'playerModel',
|
Player = 'playerModel',
|
||||||
Map = 'map'
|
Map = 'map'
|
||||||
}
|
}
|
||||||
|
@ -32,12 +33,12 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
startY = (window.innerHeight / 2) / RESOLUTION;
|
startY = (window.innerHeight / 2) / RESOLUTION;
|
||||||
|
|
||||||
|
|
||||||
constructor(RoomId : string, GameManager : GameManagerInterface) {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
key: "GameScene"
|
key: GameSceneName
|
||||||
});
|
});
|
||||||
this.RoomId = RoomId;
|
this.RoomId = connectionManager.startedRoom;
|
||||||
this.GameManager = GameManager;
|
this.GameManager = gameManager;
|
||||||
this.Terrains = [];
|
this.Terrains = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +96,6 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
|
|
||||||
//add entities
|
//add entities
|
||||||
this.Objects = new Array<Phaser.Physics.Arcade.Sprite>();
|
this.Objects = new Array<Phaser.Physics.Arcade.Sprite>();
|
||||||
this.addSpite(this.physics.add.sprite(200, 400, Textures.Rock, 26));
|
|
||||||
|
|
||||||
//init event click
|
//init event click
|
||||||
this.EventToClickOnTile();
|
this.EventToClickOnTile();
|
||||||
|
@ -104,7 +104,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
this.MapPlayers = this.physics.add.group({ immovable: true });
|
this.MapPlayers = this.physics.add.group({ immovable: true });
|
||||||
|
|
||||||
//notify game manager can to create currentUser in map
|
//notify game manager can to create currentUser in map
|
||||||
this.GameManager.createCurrentPlayer();
|
this.createCurrentPlayer();
|
||||||
|
|
||||||
|
|
||||||
//initialise camera
|
//initialise camera
|
||||||
|
@ -154,10 +154,11 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
createCurrentPlayer(UserId : string){
|
createCurrentPlayer(){
|
||||||
//initialise player
|
//initialise player
|
||||||
this.CurrentPlayer = new Player(
|
this.CurrentPlayer = new Player(
|
||||||
UserId,
|
connectionManager.userId,
|
||||||
|
connectionManager.email,
|
||||||
this,
|
this,
|
||||||
this.startX,
|
this.startX,
|
||||||
this.startY,
|
this.startY,
|
||||||
|
@ -167,6 +168,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
//create collision
|
//create collision
|
||||||
this.createCollisionWithPlayer();
|
this.createCollisionWithPlayer();
|
||||||
this.createCollisionObject();
|
this.createCollisionObject();
|
||||||
|
gameManager.createCurrentPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
EventToClickOnTile(){
|
EventToClickOnTile(){
|
||||||
|
@ -239,7 +241,7 @@ export class GameScene extends Phaser.Scene implements GameSceneInterface{
|
||||||
*/
|
*/
|
||||||
addPlayer(MessageUserPosition : MessageUserPositionInterface){
|
addPlayer(MessageUserPosition : MessageUserPositionInterface){
|
||||||
//initialise player
|
//initialise player
|
||||||
let player = new Player(
|
let player = new NonPlayer(
|
||||||
MessageUserPosition.userId,
|
MessageUserPosition.userId,
|
||||||
this,
|
this,
|
||||||
MessageUserPosition.position.x,
|
MessageUserPosition.position.x,
|
||||||
|
|
52
front/src/Phaser/Login/LogincScene.ts
Normal file
52
front/src/Phaser/Login/LogincScene.ts
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
import KeyboardKeydownCallback = Phaser.Types.Input.Keyboard.KeyboardKeydownCallback;
|
||||||
|
import {connectionManager} from "../../ConnexionManager";
|
||||||
|
import {GameSceneName} from "../Game/GameScene";
|
||||||
|
|
||||||
|
export const LoginSceneName = "LoginScene";
|
||||||
|
enum LoginTextures {
|
||||||
|
playButton = "play_button",
|
||||||
|
}
|
||||||
|
|
||||||
|
export class LogincScene extends Phaser.Scene {
|
||||||
|
private playButton: Phaser.GameObjects.Image;
|
||||||
|
private textEntry: Phaser.GameObjects.Text;
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
key: LoginSceneName
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
preload() {
|
||||||
|
this.load.image(LoginTextures.playButton, "resources/objects/play_button.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
create() {
|
||||||
|
this.add.text(10, 10, 'Enter your email:', { font: '32px Courier', fill: '#ffffff' });
|
||||||
|
|
||||||
|
this.textEntry = this.add.text(10, 50, '', { font: '32px Courier', fill: '#ffff00' });
|
||||||
|
let keySpace = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
|
||||||
|
let keyBackspace = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.BACKSPACE);
|
||||||
|
this.input.keyboard.on('keydown', (event: any) => {
|
||||||
|
if (event.keyCode === 8 && this.textEntry.text.length > 0) {
|
||||||
|
this.textEntry.text = this.textEntry.text.substr(0, this.textEntry.text.length - 1);
|
||||||
|
} else if (event.keyCode === 32 || (event.keyCode >= 48 && event.keyCode < 90)) {
|
||||||
|
this.textEntry.text += event.key;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.playButton = this.add.image(this.game.renderer.width / 2, this.game.renderer.height / 2, LoginTextures.playButton).setDepth(1);
|
||||||
|
this.playButton.setInteractive();
|
||||||
|
this.playButton.on("pointerup", this.login.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
update(time: number, delta: number): void {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async login() {
|
||||||
|
let email = this.textEntry.text;
|
||||||
|
if (!email) return;
|
||||||
|
await connectionManager.createConnexion("a.poly@thecodingmachine.com");
|
||||||
|
this.scene.start(GameSceneName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,16 +2,20 @@ import {PlayableCaracter} from "../Entity/PlayableCaracter";
|
||||||
import {Textures} from "../Game/GameScene";
|
import {Textures} from "../Game/GameScene";
|
||||||
import {UserInputEvent} from "../UserInput/UserInputManager";
|
import {UserInputEvent} from "../UserInput/UserInputManager";
|
||||||
import {Player} from "../Player/Player";
|
import {Player} from "../Player/Player";
|
||||||
import {MessageUserPositionInterface} from "../../Connexion";
|
import {MessageUserPositionInterface} from "../../ConnexionManager";
|
||||||
import {playAnimation} from "../Player/Animation";
|
import {getPlayerAnimations, playAnimation} from "../Player/Animation";
|
||||||
|
|
||||||
export class NonPlayer extends PlayableCaracter {
|
export class NonPlayer extends PlayableCaracter {
|
||||||
|
|
||||||
isFleeing: boolean = false;
|
isFleeing: boolean = false;
|
||||||
fleeingDirection:any = null //todo create a vector class
|
fleeingDirection:any = null
|
||||||
|
private userId: string;
|
||||||
|
|
||||||
|
//todo create a vector class
|
||||||
|
|
||||||
constructor(scene: Phaser.Scene, x: number, y: number) {
|
constructor(userId:string, scene: Phaser.Scene, x: number, y: number) {
|
||||||
super(scene, x, y, Textures.Player, 1);
|
super(scene, x, y, Textures.Player, 1);
|
||||||
|
this.userId = userId
|
||||||
this.setSize(32, 32); //edit the hitbox to better match the caracter model
|
this.setSize(32, 32); //edit the hitbox to better match the caracter model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +26,18 @@ export class NonPlayer extends PlayableCaracter {
|
||||||
this.setY(MessageUserPosition.position.y);
|
this.setY(MessageUserPosition.position.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
fleeFrom(player:Player) {
|
initAnimation(): void {
|
||||||
|
getPlayerAnimations().forEach(d => {
|
||||||
|
this.scene.anims.create({
|
||||||
|
key: d.key,
|
||||||
|
frames: this.scene.anims.generateFrameNumbers(d.frameModel, {start: d.frameStart, end: d.frameEnd}),
|
||||||
|
frameRate: d.frameRate,
|
||||||
|
repeat: d.repeat
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/*fleeFrom(player:Player) {
|
||||||
if (this.isFleeing) return;
|
if (this.isFleeing) return;
|
||||||
this.say("Don't touch me!");
|
this.say("Don't touch me!");
|
||||||
this.isFleeing = true;
|
this.isFleeing = true;
|
||||||
|
@ -36,5 +51,5 @@ export class NonPlayer extends PlayableCaracter {
|
||||||
let vectorX = this.x - player.x;
|
let vectorX = this.x - player.x;
|
||||||
let vectorY = this.y - player.y;
|
let vectorY = this.y - player.y;
|
||||||
this.fleeingDirection = {x: vectorX, y: vectorY}
|
this.fleeingDirection = {x: vectorX, y: vectorY}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
import {getPlayerAnimations, playAnimation, PlayerAnimationNames} from "./Animation";
|
import {getPlayerAnimations, playAnimation, PlayerAnimationNames} from "./Animation";
|
||||||
import {GameSceneInterface, Textures} from "../Game/GameScene";
|
import {GameSceneInterface, Textures} from "../Game/GameScene";
|
||||||
import {ConnexionInstance} from "../Game/GameManager";
|
import {ConnexionInstance} from "../Game/GameManager";
|
||||||
import {MessageUserPositionInterface} from "../../Connexion";
|
import {MessageUserPositionInterface} from "../../ConnexionManager";
|
||||||
import {ActiveEventList, UserInputEvent, UserInputManager} from "../UserInput/UserInputManager";
|
import {ActiveEventList, UserInputEvent, UserInputManager} from "../UserInput/UserInputManager";
|
||||||
import {PlayableCaracter} from "../Entity/PlayableCaracter";
|
import {PlayableCaracter} from "../Entity/PlayableCaracter";
|
||||||
|
|
||||||
|
@ -25,9 +25,11 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G
|
||||||
userId: string;
|
userId: string;
|
||||||
PlayerValue: string;
|
PlayerValue: string;
|
||||||
userInputManager: UserInputManager;
|
userInputManager: UserInputManager;
|
||||||
|
private email: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
userId: string,
|
userId: string,
|
||||||
|
email: string,
|
||||||
Scene: GameSceneInterface,
|
Scene: GameSceneInterface,
|
||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
|
@ -40,10 +42,12 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G
|
||||||
|
|
||||||
//set data
|
//set data
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
this.email = email;
|
||||||
this.PlayerValue = PlayerValue;
|
this.PlayerValue = PlayerValue;
|
||||||
|
|
||||||
//the current player model should be push away by other players to prevent conflict
|
//the current player model should be push away by other players to prevent conflict
|
||||||
this.setImmovable(false);
|
this.setImmovable(false);
|
||||||
|
this.say("My email is "+this.email)
|
||||||
}
|
}
|
||||||
|
|
||||||
initAnimation(): void {
|
initAnimation(): void {
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import 'phaser';
|
import 'phaser';
|
||||||
import GameConfig = Phaser.Types.Core.GameConfig;
|
import GameConfig = Phaser.Types.Core.GameConfig;
|
||||||
import {GameManager} from "./Phaser/Game/GameManager";
|
|
||||||
import {DEBUG_MODE, RESOLUTION} from "./Enum/EnvironmentVariable";
|
import {DEBUG_MODE, RESOLUTION} from "./Enum/EnvironmentVariable";
|
||||||
import {cypressAsserter} from "./Cypress/CypressAsserter";
|
import {cypressAsserter} from "./Cypress/CypressAsserter";
|
||||||
|
import {LogincScene} from "./Phaser/Login/LogincScene";
|
||||||
let gameManager = new GameManager();
|
import {GameScene} from "./Phaser/Game/GameScene";
|
||||||
|
|
||||||
const config: GameConfig = {
|
const config: GameConfig = {
|
||||||
title: "Office game",
|
title: "Office game",
|
||||||
width: window.innerWidth / RESOLUTION,
|
width: window.innerWidth / RESOLUTION,
|
||||||
height: window.innerHeight / RESOLUTION,
|
height: window.innerHeight / RESOLUTION,
|
||||||
parent: "game",
|
parent: "game",
|
||||||
scene: gameManager.GameScenes,
|
scene: [LogincScene, GameScene],
|
||||||
zoom: RESOLUTION,
|
zoom: RESOLUTION,
|
||||||
physics: {
|
physics: {
|
||||||
default: "arcade",
|
default: "arcade",
|
||||||
|
@ -23,10 +22,8 @@ const config: GameConfig = {
|
||||||
|
|
||||||
cypressAsserter.gameStarted();
|
cypressAsserter.gameStarted();
|
||||||
|
|
||||||
gameManager.createGame().then(() => {
|
let game = new Phaser.Game(config);
|
||||||
let game = new Phaser.Game(config);
|
|
||||||
|
|
||||||
window.addEventListener('resize', function (event) {
|
window.addEventListener('resize', function (event) {
|
||||||
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
|
game.scale.resize(window.innerWidth / RESOLUTION, window.innerHeight / RESOLUTION);
|
||||||
});
|
});
|
||||||
});
|
|
Loading…
Reference in a new issue