Exemple #1
0
 /// <summary>
 /// Проверяет, не столкнулись ли объекты
 /// </summary>
 protected bool IsCollision(GameObject other)
 {
     if (!other.IsDie & Position == other.Position)
     {
         return true;
     }
     return false;
 }
Exemple #2
0
 public override void HandleCollision(GameObject other)
 {
     switch (other.GetObjectType())
      {
          case GameTypes.BrickWall:
          case GameTypes.MetallWall:
          case GameTypes.Bomb:
              Position = prevPosition;
              break;
      }
 }
Exemple #3
0
        public override void HandleCollision(GameObject other)
        {
            base.HandleCollision(other);

            switch (other.GetObjectType())
            {
                case GameTypes.Enemy:
                    IsDie = true;
                    Game.Trash.Add(this);
                    Game.IsGameOver = true;
                    break;
            }
        }
Exemple #4
0
 /// <summary>
 /// Обрабатывает столкновение
 /// </summary>
 public override void HandleCollision(GameObject other)
 {
     switch (other.GetObjectType())
     {
         case GameTypes.Enemy:
         case GameTypes.BrickWall:
             other.IsDie = true;
             Game.Trash.Add(other);
             break;
         case GameTypes.Player:
             other.IsDie = true;
             Game.Trash.Add(other);
             Game.IsGameOver = true;
             break;
         case GameTypes.MetallWall:
             timer = 1;
             break;
     }
 }
Exemple #5
0
 /// <summary>
 /// Обрабатывает столкновение
 /// </summary>
 public virtual void HandleCollision(GameObject other)
 {
 }