onJoystickChangeDirectional method

  1. @override
void onJoystickChangeDirectional(
  1. JoystickDirectionalEvent event
)
override

Implementation

@override
void onJoystickChangeDirectional(JoystickDirectionalEvent event) {
  super.onJoystickChangeDirectional(event);
  if (event.directional == JoystickMoveDirectional.IDLE) {
    _isRunning = false;
    setAnimation(animIdle);
  } else if (!isDead && !_isRunning) {
    _isRunning = true;
    setAnimation(animRun);
  }
}