import {DEBUG_MODE, RESOLUTION, ROOM, ZOOM_LEVEL} from "../../Enum/EnvironmentVariable";
import Tile = Phaser.Tilemaps.Tile;
import {ITiledMap, ITiledTileSet} from "../Map/ITiledMap";
-import {cypressAsserter} from "../../Cypress/CypressAsserter";
export const GameSceneName = "GameScene";
export enum Textures {
//hook preload scene
preload(): void {
this.GameManager.setCurrentGameScene(this);
- cypressAsserter.preloadStarted();
let mapUrl = 'maps/map.json';
this.load.on('filecomplete-tilemapJSON-'+Textures.Map, (key: string, type: string, data: any) => {
// Triggered when the map is loaded
{ frameWidth: 32, frameHeight: 32 }
);
this.load.bitmapFont('main_font', 'resources/fonts/arcade.png', 'resources/fonts/arcade.xml');
-
- cypressAsserter.preloadFinished();
}
//hook initialisation
//hook create scene
create(): void {
- cypressAsserter.initStarted();
-
//initalise map
this.Map = this.add.tilemap("map");
this.map.tilesets.forEach((tileset: ITiledTileSet) => {
//initialise camera
this.initCamera();
- cypressAsserter.initFinished();
}
//todo: in a dedicated class/function?
this.createCollisionObject();
this.CurrentPlayer.on(hasMovedEventName, this.pushPlayerPosition.bind(this))
}
-
+
pushPlayerPosition(event: HasMovedEvent) {
this.GameManager.pushPlayerPosition(event);
}
import {ClickButton} from "../Components/ClickButton";
import {GameSceneName} from "../Game/GameScene";
import Image = Phaser.GameObjects.Image;
+import {cypressAsserter} from "../../Cypress/CypressAsserter";
//todo: put this constants in a dedicated file
export const LoginSceneName = "LoginScene";
}
preload() {
+ cypressAsserter.preloadStarted();
//this.load.image(LoginTextures.playButton, "resources/objects/play_button.png");
this.load.image(LoginTextures.icon, "resources/logos/tcm_full.png");
// Note: arcade.png from the Phaser 3 examples at: https://github.com/photonstorm/phaser3-examples/tree/master/public/assets/fonts/bitmap
this.load.bitmapFont(LoginTextures.mainFont, 'resources/fonts/arcade.png', 'resources/fonts/arcade.xml');
+ cypressAsserter.preloadFinished();
}
create() {
+ cypressAsserter.initStarted();
+
this.textField = new TextField(this, this.game.renderer.width / 2, 50, 'Enter your name:');
this.textField.setOrigin(0.5).setCenterAlign()
this.nameInput = new TextInput(this, this.game.renderer.width / 2 - 64, 70, 4);
}
return this.login(name);
});
-
+ cypressAsserter.initFinished();
}
update(time: number, delta: number): void {