walk on dbl click

This commit is contained in:
_Bastler 2022-01-27 14:58:16 +01:00
parent 08816ae80f
commit 55bb6fa930

View File

@ -27,7 +27,12 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
return; return;
} }
if (this.lastTime > 0 && pointer.time - this.lastTime < 500 && this.lastX == pointer.x && this.lastY == pointer.y) { if (
this.lastTime > 0 &&
pointer.time - this.lastTime < 500 &&
this.lastX == pointer.x &&
this.lastY == pointer.y
) {
const camera = this.gameScene.getCameraManager().getCamera(); const camera = this.gameScene.getCameraManager().getCamera();
const index = this.gameScene const index = this.gameScene
.getGameMap() .getGameMap()
@ -41,7 +46,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
.then((path) => { .then((path) => {
// Remove first step as it is for the tile we are currently standing on // Remove first step as it is for the tile we are currently standing on
path.shift(); path.shift();
this.gameScene.CurrentPlayer.setPathToFollow(path).catch((reason) => { }); this.gameScene.CurrentPlayer.setPathToFollow(path).catch((reason) => {});
}) })
.catch((reason) => { .catch((reason) => {
console.warn(reason); console.warn(reason);
@ -53,7 +58,7 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
this.lastY = pointer.y; this.lastY = pointer.y;
} }
public handlePointerDownEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void { } public handlePointerDownEvent(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]): void {}
public handleSpaceKeyUpEvent(event: Event): Event { public handleSpaceKeyUpEvent(event: Event): Event {
this.gameScene.activateOutlinedItem(); this.gameScene.activateOutlinedItem();