public override void ContactObject(MoveObject mobject, out bool needRemove) { if (mobject is Tank) { (mobject as Tank).Weapon.interval = 3; needRemove = true; } else needRemove = false; }
public override void ContactObject(MoveObject mobject, out bool needRemove) { if (mobject is BonusBase) { needRemove = false; } else { needRemove = true; } }
public override bool IsNeedRemove(MoveObject mobject) { if (mobject is Bullet) { return(true); } else { return(false); } }
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); } }
public override void ContactObject(MoveObject mobject, out bool needRemove) { if (mobject is Bullet) { HealthPoint--; } if (HealthPoint <= 0) { needRemove = true; } else { needRemove = false; } }
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); }
public virtual void ContactObject(MoveObject mobject, out bool needRemove) { needRemove = false; }
public void AddMoveObject(MoveObject mobject) { GameObject.Add(mobject); }
public virtual bool IsNeedRemove(MoveObject mobject) { return(false); }