Ejemplo n.º 1
0
        private void SetEnemyBullet(BulletBase bullet)
        {
            var   random = RandomProvider.Random;
            var   enemyToFirePosition = random.Next(0, ActiveEnemies.Count);
            Enemy enemyToFire;

            try
            {
                enemyToFire =
                    ActiveEnemies.Skip(enemyToFirePosition - 1).First();
            }
            catch (Exception)
            {
                enemyToFire = EnemyList.First();
            }

            bullet.Left = enemyToFire.Left + GameConfigurations.EnemyWidth * 0.5;
            bullet.Top  = enemyToFire.Top + GameConfigurations.EnemyHeight * 0.75;
        }