Example #1
0
 public static void Lost()
 {
     if (!PlayerProfile.sounds)
     {
         return;
     }
     OnLost.Invoke();
 }
Example #2
0
 public void HandleInput(Vector2 touchPosition)
 {
     foreach (var button in _buttons)
     {
         if (button.IsTouched(touchPosition))
         {
             if (button.ColorWithName.ColorName == CurrentWord)
             {
                 OnWon?.Invoke(null, EventArgs.Empty);
                 return;
             }
             else
             {
                 OnLost?.Invoke(null, EventArgs.Empty);
                 return;
             }
         }
     }
 }
            /// <summary>
            /// Calls the appropriate StatusUpdate events for this target.
            /// </summary>
            public void HandleStatusUpdates(MLImageTracker.Target target, MLImageTracker.Target.Result result)
            {
                if (result.Status != Status)
                {
                    Status = result.Status;

                    if (Status == MLImageTracker.Target.TrackingStatus.Tracked || Status == MLImageTracker.Target.TrackingStatus.Unreliable)
                    {
                        OnFound?.Invoke(target, result);
                    }

                    else
                    {
                        OnLost?.Invoke(target, result);
                    }
                }
                else
                {
                    OnUpdated?.Invoke(target, result);
                }
            }
Example #4
0
    public bool Move(Direction direction)
    {
        bool didMove = false;

        _CombinedList.Clear();
        switch (direction)
        {
        case Direction.Down:
            didMove = MoveDown();
            break;

        case Direction.Up:
            didMove = MoveUp();
            break;

        case Direction.Right:
            didMove = MoveRight();
            break;

        case Direction.Left:
            didMove = MoveLeft();
            break;
        }

        if (didMove)
        {
            AddRandom();
        }

        if (IsGameLost())
        {
            OnLost?.Invoke();
            return(false);
        }
        else
        {
            return(didMove);
        }
    }
Example #5
0
 private void HandleCollisions()
 {
     //intersections
     foreach (var enemy in enemies)
     {
         if (enemy.MinY < -0.8f)
         {
             //game lost
             Lost = true;
             OnLost?.Invoke(this, null);
         }
         foreach (var bullet in bullets)
         {
             if (bullet.Intersects(enemy))
             {
                 //delete bullet and enemy
                 OnEnemyDestroy?.Invoke(this, null);
                 bullets.Remove(bullet);
                 enemies.Remove(enemy);
                 return;
             }
         }
     }
 }
Example #6
0
 private void OnConnectionLost(Connection connection, ConnectionType type, CloseReason reason)
 => OnLost?.Invoke(connection, type, reason);
Example #7
0
 // OnTriggerExit is called when detectable
 // object is lost of sight.
 private void OnTriggerExit(Collider other)
 {
     OnLost.Invoke(other.gameObject);
 }
 public void FireLostEvent()
 {
     Stability = 0;
     Visible   = false;
     OnLost?.Invoke();
 }
Example #9
0
 public void ActivateLost(string loss_message = "")
 {
     OnLost?.Invoke(loss_message);
 }