onJoystickChangeDirectional method
Implementation
@override
void onJoystickChangeDirectional(JoystickDirectionalEvent event) {
JoystickMoveDirectional newDirectional = JoystickMoveDirectional.IDLE;
if (event.directional.isRight) {
newDirectional = JoystickMoveDirectional.MOVE_RIGHT;
} else if (event.directional.isLeft) {
newDirectional = JoystickMoveDirectional.MOVE_LEFT;
}
super.onJoystickChangeDirectional(
event.copyWith(
directional: newDirectional,
),
);
}