public override void Move() { //If is falling, dont move if (IsFalling) { return; } Vector2 movVector = Mobile.Position - ((RaonLauncherMineS2)Mobile).Target.Position; if (Math.Abs(movVector.X) < 1) { OnInvalidMovemenAttempt?.Invoke(); } bool canMove = IsAbleToMove; //and move to the left if (movVector.X > 0) { MoveSideways(Mobile.Facing); } else if (movVector.X < 0) { MoveSideways(Mobile.Facing); } if (canMove && !IsAbleToMove) { OnRemaningMovementEnds?.Invoke(); } }
public override void Move() { //If is falling, dont move if (IsFalling) { return; } MoveSideways(Mobile.Facing); if (!IsAbleToMove) { OnRemaningMovementEnds?.Invoke(); } }