public override void WeaponsControll(List <GameObject> GameObjects, Destroyer myShip) { this.Move(); //このCollisionDetectionをGameObjects List内のすべてのSubmarineに対して行う必要がある。 for (int j = GameObjects.Count - 1; j >= 0; j--) { if (GameObjects[j] is Submarine && this.Disappear == false) { Submarine sub = GameObjects[j] as Submarine; if (this.CollisionDetection(GameObjects[j].PositionX, GameObjects[j].PositionY, SwinGame.BitmapWidth(sub.Image), SwinGame.BitmapHeight(sub.Image))) { sub.Disappear = true; myShip.Hit++; } } } }
public abstract void WeaponsControll(List <GameObject> GameObjects, Destroyer myShip);
public DepthCharge(Destroyer myShip) { PositionX = myShip.PositionX; PositionY = myShip.PositionY + myShip.Image.Height; }
public void Initialize() { des = Destroyer.GetInstance(2, 2); list = new List <GameObject>(); sub = new Submarine(2); }