moveFromAngle method

  1. @override
void moveFromAngle(
  1. double angle, {
  2. double? speed,
})
override

Move Player to direction by radAngle

Implementation

@override
void moveFromAngle(double angle, {double? speed}) {
  if (_perCellEnabled) {
    switch (BonfireUtil.getDirectionFromAngle(angle, directionSpace: 45)) {
      case Direction.left:
        moveLeft();
        break;
      case Direction.right:
        moveRight();
        break;
      case Direction.up:
        moveUp();
        break;
      case Direction.down:
        moveDown();
        break;
      default:
    }
  } else {
    super.moveFromAngle(angle, speed: speed);
  }
}