public override void ContactObject(MoveObject mobject, out bool needRemove)
 {
     if (mobject is Tank)
      {
          (mobject as Tank).Weapon.interval = 3;
          needRemove = true;
      }
      else
          needRemove = false;
 }
Beispiel #2
0
 public override void ContactObject(MoveObject mobject, out bool needRemove)
 {
     if (mobject is BonusBase)
     {
         needRemove = false;
     }
     else
     {
         needRemove = true;
     }
 }
Beispiel #3
0
 public override bool IsNeedRemove(MoveObject mobject)
 {
     if (mobject is Bullet)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #4
0
 public bool Contact(MoveObject mobject1, MoveObject mobject2)
 {
     if (mobject1.X >= (mobject2.X + mobject2.Width) || (mobject1.X + mobject1.Width) <= mobject2.X)
     {
         return(false);
     }
     if (mobject1.Y >= (mobject2.Y + mobject2.Width) || (mobject1.Y + mobject1.Width) <= mobject2.Y)
     {
         return(false);
     }
     return(true);
 }
        public override bool IsNeedRemove(MoveObject mobject)
        {
            var bul = mobject as Bullet;

            if (bul != null && bul.Power > 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #6
0
 public override void ContactObject(MoveObject mobject, out bool needRemove)
 {
     if (mobject is Bullet)
     {
         HealthPoint--;
     }
     if (HealthPoint <= 0)
     {
         needRemove = true;
     }
     else
     {
         needRemove = false;
     }
 }
Beispiel #7
0
        public TileBase IntersectionTile(MoveObject mobject)
        {
            TileBase tile = null;

            int RowUp    = mobject.Y / Constants.tileWidth;
            int ColLeft  = mobject.X / Constants.tileWidth;
            int RowDown  = (mobject.Y + mobject.Width - 1) / Constants.tileWidth;
            int ColRight = (mobject.X + mobject.Width - 1) / Constants.tileWidth;

            for (int r = RowUp; r <= RowDown; ++r)
            {
                for (int c = ColLeft; c <= ColRight; ++c)
                {
                    TileBase t = GetTile(r, c);
                    if (t == null)
                    {
                        if (tile == null)
                        {
                            tile = new TileBorder();
                        }
                        continue;
                    }

                    if ((t is TileWater && mobject is Bullet) || t is TileEmpty)
                    {
                        continue;
                    }

                    if (t.IsNeedRemove(mobject))
                    {
                        RemoveTile(t);
                    }

                    if (tile == null)
                    {
                        tile = t;
                    }
                }
            }
            return(tile);
        }
Beispiel #8
0
 public virtual void ContactObject(MoveObject mobject, out bool needRemove)
 {
     needRemove = false;
 }
Beispiel #9
0
 public void AddMoveObject(MoveObject mobject)
 {
     GameObject.Add(mobject);
 }
Beispiel #10
0
 public virtual bool IsNeedRemove(MoveObject mobject)
 {
     return(false);
 }