do not move player if clicked on Player or RemotePlayer. Close actionsMenu on second click

This commit is contained in:
Hanusiak Piotr 2022-01-25 15:47:21 +01:00
parent 907026463d
commit 88f3032298
2 changed files with 18 additions and 0 deletions

View file

@ -1,3 +1,6 @@
import { Player } from '../Player/Player';
import { RemotePlayer } from '../Entity/RemotePlayer';
import type { UserInputHandlerInterface } from "../../Interfaces/UserInputHandlerInterface";
import type { GameScene } from "../Game/GameScene";
@ -22,6 +25,12 @@ export class GameSceneUserInputHandler implements UserInputHandlerInterface {
if (pointer.rightButtonReleased() || pointer.getDuration() > 250) {
return;
}
for (const object of gameObjects) {
if (object instanceof Player || object instanceof RemotePlayer) {
return;
}
}
console.log(gameObjects);
const camera = this.gameScene.getCameraManager().getCamera();
const index = this.gameScene
.getGameMap()