Ejemplo n.º 1
0
 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++;
             }
         }
     }
 }
Ejemplo n.º 2
0
 public abstract void WeaponsControll(List <GameObject> GameObjects, Destroyer myShip);
Ejemplo n.º 3
0
 public DepthCharge(Destroyer myShip)
 {
     PositionX = myShip.PositionX;
     PositionY = myShip.PositionY + myShip.Image.Height;
 }
Ejemplo n.º 4
0
 public void Initialize()
 {
     des  = Destroyer.GetInstance(2, 2);
     list = new List <GameObject>();
     sub  = new Submarine(2);
 }