Пример #1
0
        public Enemy(Game1 game, Level level)
        {
            int randomType = Game1.Random.Next(0, 100);

            if (randomType < level.levelData.i_EnemyMinorChance)
            {
                ed_EnemyData = game.EnemyDataForType(EnemyData.Type.Normal);
            }
            else if (randomType < (level.levelData.i_EnemyMajorChance + level.levelData.i_EnemyMinorChance))
            {
                ed_EnemyData = game.EnemyDataForType(EnemyData.Type.Destroyer);
            }

            InitaliseEnemy(game);
        }
Пример #2
0
        public EnemyData EnemyDataForType(EnemyData.Type type)
        {
            for (int i = 0; i < enemiesData.Length; i++)
            {
                if (enemiesData[i].t_Type == type)
                {
                    return enemiesData[i];
                }
            }

            return null;
        }
Пример #3
0
 public Enemy(Game1 game, EnemyData.Type type)
 {
     ed_EnemyData = game.EnemyDataForType(type);
     InitaliseEnemy(game);
 }