Keyboard constructor

Keyboard({
  1. dynamic id,
  2. KeyboardConfig? config,
  3. PlayerControllerListener? observer,
})

Class responsible to adds a keyboard controller in your game. If pass oberver this param, the joystick will controll this observer and not the Component passed in player param.

Implementation

Keyboard({
  super.id,
  KeyboardConfig? config,
  PlayerControllerListener? observer,
}) : keyboardConfig = config ?? KeyboardConfig() {
  if (observer != null) {
    addObserver(observer);
  }
}