Kerby64
    Preparing search index...

    Class InputManager

    The InputManager class handles input events for the game.
    It extends the MouseManager class to capture mouse events and pointer lock state.
    It manages keyboard input for various game controls and provides a way to track mouse movement.

    Hierarchy

    • InputManager
      • InputManager
    Index

    Constructors

    Properties

    actualGame: Games = Games.none

    The game currently being played.
    This is used to determine which game is currently active and what controls to apply.
    F1 open the github page in classic and rush, but not in world, it toggles the UI)

    inputMap: {
        AltLeft: boolean;
        ControlLeft: boolean;
        Escape: boolean;
        F1: boolean;
        F2: boolean;
        F3: boolean;
        F5: boolean;
        KeyA: boolean;
        KeyD: boolean;
        KeyS: boolean;
        KeyT: boolean;
        KeyW: boolean;
        lclick: boolean;
        rclick: boolean;
        ShiftLeft: boolean;
        Space: boolean;
    } = ...

    Map of input keys to their pressed state.
    This is used to track which keys are currently pressed down.
    The keys are defined in the Key enum.
    The keys are set to false by default, and are set to true when the key is pressed down.

    inputMap[Key.Up] == true // the up key is pressed down
    inputMap[Key.Down] == false // the down key is not pressed down
    isPointerLocked: boolean = false

    Flag to indicate if the pointer is currently locked to the canvas.
    This is used to determine if the mouse movement should be captured or not.

    isWorldPlaying: boolean = false

    Flag to indicate if the world game is currently being played.
    This is used to determine if the game is in the world mode or not.

    use actualGame instead.

    Remove this in the future.

    MouseMovement: { x: number; y: number } = ...

    The mouse movement since the game has retrieved the data.
    This is used to rotate the camera in the world game.
    It is not reset automatically, unless the pointer is not locked.