示例#1
0
        public void NextCommand()
        {
            VirtualCommand command = gameplayDesigner.GetNextCommand();

            if (command == null)
            {
                return;
            }

            command.Execute();
        }
示例#2
0
        public override VirtualCommand GetNextCommand()
        {
            if (commands.Count == 0)
            {
                return(null);
            }

            VirtualCommand command = commands[0];

            commands.RemoveAt(0);

            return(command);
        }
        void Next()
        {
            //Debug.Log("it - " + iterator);

            if (iterator >= commands.Count)
            {
                Finish();
                return;
            }

            VirtualCommand com = commands[iterator];

            //commands.RemoveAt(0);
            iterator++;
            com.Execute();
        }
示例#4
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 };
        }