Beispiel #1
0
        public void ProduceEnemyBullet()//敌机产生子弹
        {
            Random rand = new Random(Guid.NewGuid().GetHashCode());

            for (int i = 0; i < enemyList.Count; i++)
            {
                if (0 == rand.Next(20))
                {
                    int         x    = enemyList[i].ENEMY_X + 20;
                    int         y    = enemyList[i].ENEMY_Y + 20;
                    int         disX = x - (player.PLANEX + 20);
                    int         disY = y - (player.PLANEY + 20);
                    EnemyBullet eb   = new EnemyBullet(x, y, disX, disY);
                    ebList.Add(eb);
                }
            }
        }
Beispiel #2
0
 //敌机产生子弹
 public void ProduceEnemyBullet()
 {
     Random rand = new Random(Guid.NewGuid().GetHashCode());
     for (int i = 0; i < enemyList.Count; i++)
     {
         if (0 == rand.Next(20))
         {
             int x = enemyList[i].ENEMY_X + 20;
             int y = enemyList[i].ENEMY_Y + 20;
             int disX = x - (player.PLANEX + 20);
             int disY = y - (player.PLANEY + 20);
             EnemyBullet eb = new EnemyBullet(x, y, disX, disY);
             ebList.Add(eb);
         }
     }
 }