public BasicDesigner()
        {
            VirtualCommand timer    = new Command.Wait(5);
            VirtualCommand levelEnd = new Command.WaitTillLevelEnd();

            PleacmentStrategy      pleacment      = new RandomAroundScreen().Set(1, 0.5f, true, true, true, true);
            PleacmentStrategy      pleacment2     = new RandomAroundScreen().Set(2, 0.5f, true, true, true, true);
            UnleashStrategy        unleash        = new UnleashOverTime().SetOverTime(2, 0.1f);
            AbstractObjectsCreator objectsCreator = new AsteroidObjectsCreator(1);

            VirtualCommand spawn  = new Command.ObjectsGeneratorCommand(objectsCreator, pleacment, unleash, 10);
            VirtualCommand spawn2 = new Command.ObjectsGeneratorCommand(objectsCreator, pleacment2, unleash, 10);

            commands = new List <VirtualCommand>();

            VirtualCommand round = new CompositeCommand(spawn, timer, spawn2, levelEnd);

            for (int i = 0; i < 10; i++)
            {
                commands.Add(round);
            }
        }
Exemple #2
0
        public InfiniteDesign()
        {
            round = 0;
            waves = 1;

            timer    = new Command.Wait(10);
            levelEnd = new Command.WaitTillLevelEnd();

            float             outScreenOffset = 0.75f;
            PleacmentStrategy pleacment       = new RandomAroundScreen().Set(outScreenOffset, 0.5f, true, true, true, true);

            float             notRandSpacing    = 2f;
            PleacmentStrategy notRandPleacment1 = new NotRandomAroundScreen().Set(outScreenOffset, notRandSpacing, true, false, false, false);
            PleacmentStrategy notRandPleacment2 = new NotRandomAroundScreen().Set(outScreenOffset, notRandSpacing, false, true, false, false);
            PleacmentStrategy notRandPleacment3 = new NotRandomAroundScreen().Set(outScreenOffset, notRandSpacing / 2, false, false, true, false);
            PleacmentStrategy notRandPleacment4 = new NotRandomAroundScreen().Set(outScreenOffset, notRandSpacing / 2, false, false, false, true);
            PleacmentStrategy notRandPleacment  = new PleacmentComposite(notRandPleacment1, notRandPleacment2, notRandPleacment3, notRandPleacment4);

            unleashOneByOne = new UnleashOverTime()
                              .SetOverTime(1, 3f)
                              .SetAsteroidSpeed(1.4f) as UnleashOverTime;

            UnleashStrategy unleashInstant = new InstantUnleash()
                                             .SetAsteroidSpeed(0.7f);
            UnleashStrategy unleashWave = new UnleashWave()
                                          .SetOverTime(1, 1)
                                          .SetAsteroidSpeed(1.2f);

            objectsCreator = new AsteroidObjectsCreator(1);

            generatorCommands    = new ObjectsGeneratorCommand[3];
            generatorCommands[0] = new Command.ObjectsGeneratorCommand(objectsCreator, pleacment, unleashInstant, 5);
            generatorCommands[1] = new Command.ObjectsGeneratorCommand(objectsCreator, pleacment, unleashOneByOne, 8);
            generatorCommands[2] = new Command.ObjectsGeneratorCommand(objectsCreator, notRandPleacment, unleashWave, 8);

            asteroidsChances = new float[] { 5, 0, 0 };
        }