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