moveUpRight method

bool moveUpRight(
  1. double speedX,
  2. double speedY
)

Move player to Up and Right

Implementation

bool moveUpRight(double speedX, double speedY) {
  bool successRight = moveRight(
    speedX * REDUCTION_SPEED_DIAGONAL,
    notifyOnMove: false,
  );
  bool successUp = moveUp(
    speedY * REDUCTION_SPEED_DIAGONAL,
    notifyOnMove: false,
  );
  if (successRight && successUp) {
    lastDirection = Direction.upRight;
  }
  if (successRight | successUp) {
    onMove(
      speed,
      lastDirection,
      BonfireUtil.getAngleFromDirection(lastDirection),
    );
    return true;
  } else {
    onMove(
      0,
      Direction.upRight,
      BonfireUtil.getAngleFromDirection(Direction.upRight),
    );
    return false;
  }
}