moveUp method

  1. @override
bool moveUp(
  1. double speed, {
  2. bool notifyOnMove = true,
})
override

Move player to Up

Implementation

@override
bool moveUp(double speed, {bool notifyOnMove = true}) {
  if (animation?.runUp != null) {
    animation?.play(SimpleAnimationEnum.runUp);
  } else {
    if (lastDirectionHorizontal == Direction.left) {
      animation?.play(SimpleAnimationEnum.runLeft);
    } else {
      animation?.play(SimpleAnimationEnum.runRight);
    }
  }
  return super.moveUp(speed, notifyOnMove: notifyOnMove);
}