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