Input Forge - v0.3.1
    Preparing search index...

    Class TickCommandAbstract

    Command that receives tick events every frame, regardless of input state. Use this for commands that need to run continuously, like physics or animations.

    To use TickCommand, you must:

    1. Add it to your input map with systemInput: Inputs.SYSTEM_TICK
    2. Call inputManager.startTick() to begin the tick loop
    class PhysicsCommand extends TickCommand {
    constructor(private world: PhysicsWorld) {
    super();
    }

    tick(delta: number): void {
    // delta is milliseconds since last frame
    this.world.step(delta / 1000);
    }
    }

    // In your input map:
    const inputMap = {
    id: 'gameplay',
    singleInput: {
    physics: { systemInput: Inputs.SYSTEM_TICK, command: new PhysicsCommand(world) }
    }
    };

    // Start the tick loop:
    inputManager.startTick();

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Called once when the input becomes inactive. Override this to handle cleanup or end states.

      Returns void

    • Called every frame when the tick loop is running.

      Parameters

      • _delta: number

        Time in milliseconds since the last frame

      Returns void

    • Called once when the input becomes active. Override this to handle the initial input event.

      Parameters

      • Optional_value: void

        Optional value associated with the input

      Returns void

    • Called every frame while the input remains active. Override this to handle continuous input.

      Parameters

      • Optional_value: void

        Optional value associated with the input

      Returns void