Exemple #1
0
        public Boss CreateBoss(BossType enemyType, Vector2 position)
        {
            Boss boss;
            uint id = NextID();

            switch (enemyType)
            {
            case BossType.Blimp:
                boss = new Blimp(id, position, content);
                QueueGameObjectForCreation(new LeftGun(NextID(), content, boss as Blimp));
                QueueGameObjectForCreation(new RightGun(NextID(), content, boss as Blimp));
                break;

            case BossType.TwinJetManager:
                boss = new TwinJetManager(id, content, position);
                break;

            default:
                throw new NotImplementedException("The boss type " + Enum.GetName(typeof(BossType), enemyType) + " is not supported");
            }
            boss.ObjectType = ObjectType.Boss;
            QueueGameObjectForCreation(boss);
            return(boss);
        }
        public Boss CreateBoss(BossType enemyType, Vector2 position)
        {
            Boss boss;
            uint id = NextID();
            switch (enemyType)
            {
                case BossType.Blimp:
                    boss = new Blimp(id, position, content);
                    QueueGameObjectForCreation(new LeftGun(NextID(), content, boss as Blimp));
                    QueueGameObjectForCreation(new RightGun(NextID(), content, boss as Blimp));
                    break;

                case BossType.TwinJetManager:
                    boss = new TwinJetManager(id, content, position);
                    break;
                case BossType.Bird:
                    boss = new Bird(id, content, position);
                    break;
                default:
                    throw new NotImplementedException("The boss type " + Enum.GetName(typeof(BossType), enemyType) + " is not supported");
            }
            boss.ObjectType = ObjectType.Boss;
            QueueGameObjectForCreation(boss);
            return boss;
        }
        public Boss CreateBoss(BossType enemyType, Vector2 position)
        {
            Boss boss;
            uint id = NextID();
            switch (enemyType)
            {
                case BossType.Blimp:
                    Blimp blimp = new Blimp(id, position, content);
                    LeftGun leftGun = new LeftGun(NextID(), content, blimp);
                    RightGun rightGun = new RightGun(NextID(), content, blimp);
                    leftGun.ObjectType = ObjectType.Boss;
                    rightGun.ObjectType = ObjectType.Boss;
                    blimp.leftGun = leftGun;
                    blimp.rightGun = rightGun;
                    QueueGameObjectForCreation(leftGun);
                    QueueGameObjectForCreation(rightGun);
                    boss = blimp;
                    break;

                case BossType.TwinJetManager:
                    boss = new TwinJetManager(id, content, position);
                    break;

                case BossType.MoonBoss:
                    boss = new MoonBoss(id, content, position);
                    break;
                case BossType.Lavabug:
                    boss = new Lavabug(id, content, position);
                    break;

                case BossType.BrainBoss:
                    boss = new BrainBossWrapper(id, content, position);
                    break;

                case BossType.Bird:
                    boss = new Bird(id, content, position);
                    break;

                default:
                    throw new NotImplementedException("The boss type " + Enum.GetName(typeof(BossType), enemyType) + " is not supported");
            }
            boss.ObjectType = ObjectType.Boss;
            QueueGameObjectForCreation(boss);
            return boss;
        }