created interface to implement for UserInputManager
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user