created interface to implement for UserInputManager
This commit is contained in:
parent
b1cad1e5d3
commit
173d10738d
4 changed files with 90 additions and 44 deletions
25
front/src/Phaser/UserInput/GameSceneUserInputHandler.ts
Normal file
25
front/src/Phaser/UserInput/GameSceneUserInputHandler.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import type { UserInputHandlerInterface } from "../../Interfaces/UserInputHandlerInterface";
|
||||
import type { GameScene } from "../Game/GameScene";
|
||||
|
||||
export class GameSceneUserInputHandler implements UserInputHandlerInterface {
|
||||
private gameScene: GameScene;
|
||||
|
||||
constructor(gameScene: GameScene) {
|
||||
this.gameScene = gameScene;
|
||||
}
|
||||
|
||||
public handleMouseWheelEvent(
|
||||
pointer: Phaser.Input.Pointer,
|
||||
gameObjects: Phaser.GameObjects.GameObject[],
|
||||
deltaX: number,
|
||||
deltaY: number,
|
||||
deltaZ: number
|
||||
): void {
|
||||
this.gameScene.zoomByFactor(1 - (deltaY / 53) * 0.1);
|
||||
}
|
||||
|
||||
public handleSpaceKeyUpEvent(event: Event): Event {
|
||||
this.gameScene.activateOutlinedItem();
|
||||
return event;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue