예제 #1
0
        public void GenerateInvader()
        {
            Random random  = new Random();
            int    x       = random.Next(10, 70);
            var    invader = new Invader(x, 0);

            Invaders.Add(invader);
        }
예제 #2
0
 private bool CheckKill(Bullet bullet)
 {
     if (bullet != null)
     {
         var killedInvader = Invaders.Find(x => x.PositionX == bullet.PositionX && x.PositionY == bullet.PositionY);
         if (killedInvader != null)
         {
             Invaders.Remove(killedInvader);
             GameScore++;
             return(true);
         }
         return(false);
     }
     return(false);
 }