Exemple #1
0
        public override void Initialize()
        {
            base.Initialize();

            EliminationBoss boss = new EliminationBoss(Game, player, spriteSheet, this, 0);

            untriggeredEvents.Add(boss);

            LevelEvent    swarm     = new EvenSwarm(Game, player, spriteSheet, this, EnemyType.meteor, 0, 35000, 30);
            SetupCreature testSetup = new SetupCreature();

            testSetup.SetMovement(Movement.FullStop);
            swarm.CreatureSetup(testSetup);
            untriggeredEvents.Add(swarm);

            LevelEvent trueMessage = new SimpleMessageVertical(Game, player, spriteSheet, this, 2000, "HELLUUU!!");

            untriggeredEvents.Add(trueMessage);

            LevelEvent trueMessage2 = new SimpleMessageVertical(Game, player, spriteSheet, this, 3000, "HELLUUU2!!");

            untriggeredEvents.Add(trueMessage2);

            LevelEvent trueMessage3 = new SimpleMessageVertical(Game, player, spriteSheet, this, 5000, "HELLUUU33!!");

            untriggeredEvents.Add(trueMessage3);

            LevelEvent message = new SingleEnemy(Game, player, spriteSheet, this, EnemyType.R_mosquito, 3000, 100);

            untriggeredEvents.Add(message);

            SetCustomVictoryCondition(LevelObjective.Boss, -1);
        }
        public EliminationBoss(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level, float startTime) :
            base(Game, player, spriteSheet, level, startTime)
        {
            float         x1     = 1 * level.LevelWidth / 6;
            SetupCreature setup1 = new SetupCreature();

            setup1.SetBossMovement(100);
            SingleEnemy event1 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.turret, 0, x1);

            event1.CreatureSetup(setup1);
            waveEvents.Add(event1);

            float         x2     = 2 * level.LevelWidth / 6;
            SetupCreature setup2 = new SetupCreature();

            setup2.SetBossMovement(200);
            SingleEnemy event2 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.turret, 0, x2);

            event2.CreatureSetup(setup2);
            waveEvents.Add(event2);

            float         x3     = 3 * level.LevelWidth / 6;
            SetupCreature setup3 = new SetupCreature();

            setup3.SetBossMovement(300);
            SingleEnemy event3 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.turret, 0, x3);

            event3.CreatureSetup(setup3);
            waveEvents.Add(event3);

            float         x4     = 4 * level.LevelWidth / 6;
            SetupCreature setup4 = new SetupCreature();

            setup4.SetBossMovement(200);
            SingleEnemy event4 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.turret, 0, x4);

            event4.CreatureSetup(setup4);
            waveEvents.Add(event4);

            float         x5     = 5 * level.LevelWidth / 6;
            SetupCreature setup5 = new SetupCreature();

            setup5.SetBossMovement(100);
            SingleEnemy event5 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.turret, 0, x5);

            event5.CreatureSetup(setup5);
            waveEvents.Add(event5);

            CompileEvents();
        }
        public HangarBoss(Game1 Game, PlayerVerticalShooter player, Sprite spriteSheet, Level level, float startTime) :
            base(Game, player, spriteSheet, level, startTime)
        {
            float         x1     = level.LevelWidth / 2;
            SetupCreature setup1 = new SetupCreature();

            setup1.SetBossMovement(100);
            SingleEnemy event1 = new SingleEnemy(Game, player, spriteSheet, level, EnemyType.A_hangar, 0, x1);

            event1.CreatureSetup(setup1);
            waveEvents.Add(event1);

            CompileEvents();
        }
Exemple #4
0
        private void CreatePointEvent(String state, float pos, float time)
        {
            //To prevent enemies at position 0 from being removed
            if (pos == 0)
            {
                pos = 1;
            }
            //

            String enemyData    = state.Substring(0, 1);
            String movementData = state.Substring(1, 2);
            String eventData    = state.Substring(3, 1);

            SortedDictionary <string, int> settings = new SortedDictionary <string, int>();

            MatchCollection matches = Regex.Matches(state, @"([XYWHD])(\d+)");

            foreach (Match match in matches)
            {
                String letter      = match.Groups[1].Value;
                String valueString = match.Groups[2].Value;
                int    value       = Convert.ToInt32(valueString);
                settings.Add(letter, value);
            }
            //String enemy = SaveLoadStringLibrary.GetEnemyTypeFromSaveString(enemyData);
            String    enemy      = enemyData;
            EnemyType identifier = DataConversionLibrary.GetEnemyEnumFromString(enemy);
            Movement  movement   = DataConversionLibrary.GetMovementEnumFromString(movementData);

            #region switchEventData
            switch (eventData)
            {
            case "0":
            {
                LevelEvent lvEv = new SingleEnemy(Game, player, spriteSheet, this, identifier, time, pos);
                SetMovement(lvEv, movement);
                untriggeredEvents.Add(lvEv);
                break;
            }

            // The horizontal event forces a horizontal movement
            case "h":
            {
                int direction = settings["D"];
                int yPos      = settings["Y"];

                LevelEvent lvEv = new SingleHorizontalEnemy(Game, player, spriteSheet, this, identifier, time, direction, yPos);

                if (direction == 1)
                {
                    SetMovement(lvEv, Movement.RightHorizontal);
                }
                else
                {
                    SetMovement(lvEv, Movement.LeftHorizontal);
                }

                untriggeredEvents.Add(lvEv);
                break;
            }

            case "l":
            {
                int        width    = settings["W"];
                int        xspacing = settings["X"];
                LevelEvent lvEv     = new LineFormation(Game, player, spriteSheet, this, identifier, time, width, xspacing, pos);

                SetMovement(lvEv, movement);

                untriggeredEvents.Add(lvEv);
                break;
            }

            case "s":
            {
                int        width    = settings["W"];
                int        xspacing = settings["X"];
                int        height   = settings["H"];
                int        yspacing = settings["Y"];
                LevelEvent lvEv     = new SquareFormation(Game, player, spriteSheet, this, identifier, time, width, height, xspacing, yspacing, pos);

                SetMovement(lvEv, movement);

                untriggeredEvents.Add(lvEv);
                break;
            }

            case "t":
            {
                int        height   = settings["H"];
                int        xspacing = settings["X"];
                int        yspacing = settings["Y"];
                LevelEvent lvEv     = new VFormation(Game, player, spriteSheet, this, identifier, time, height, xspacing, yspacing, pos);

                SetMovement(lvEv, movement);

                untriggeredEvents.Add(lvEv);
                break;
            }
            }
            #endregion
        }