public override void Intialize()
        {
            GC.Collect();
            base.Intialize();

            AddBackground(GlobalVariables.Background);

            levelData.LoadLevel();

            TotalNumberOfZipFiles = levelData.NumberOfZip;
            if (levelData.NumberOfDocumentFiles == 0)
            {
                TotalNumberOfDocumentFiles = int.MaxValue;
            }
            else
            {
                TotalNumberOfDocumentFiles = levelData.NumberOfDocumentFiles;
            }

            foreach (BaseGenerator generator in levelData.Generator)
            {
                AddEntity(generator);
            }

            AddEntity(new PlayerEntity(levelData.StartPosition, GlobalVariables.TopPlayer, GlobalVariables.BottomPlayer));

            HUDEntity.GameScoreType = GlobalVariables.GetSurvivalHUDVariable();
            OGE.CurrentWorld.AddOverLayer(new HUDEntity());
            CursorEntity.CursorView = CursorType.Aim;

            int trackNumber = OGE.Random.Next(DriveData.MAX_DRIVE_NUMBER) + 1;
            if (trackNumber < 5)
            {
                SoundManager.PlayMusic("ingame" + trackNumber.ToString() + (OGE.Random.Next(3) + 1).ToString());
            }
            else
            {
                SoundManager.PlayMusic("ingame" + trackNumber.ToString());
            }

            LevelNameAnnouncerEntity levelTitle = new LevelNameAnnouncerEntity(null, levelData.LevelName,
                (GlobalVariables.SurvivalMode + 1));
            levelTitle.TintColor = new Color(150, 255, 130);

            AddOverLayer(levelTitle);
        }
示例#2
0
        public override void Intialize()
        {
            GC.Collect();
            base.Intialize();

            AddBackground(GlobalVariables.Background);

            levelData.LoadLevel();
            BaseEntity boss = levelData.GetBoss();
            if (boss != null)
            {
                AddEntity(boss);
                SoundManager.PlayMusic("boss");
            }
            else
            {
                if (GlobalVariables.CurrentDrive < 5)
                {
                    if (!SoundManager.CurrentRunningMusic.Contains("ingame"))
                    {
                        SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive + (OGE.Random.Next(3) + 1).ToString());
                    }
                }
                else
                {
                    SoundManager.PlayMusic("ingame" + GlobalVariables.CurrentDrive);
                }
            }

            TotalNumberOfZipFiles = levelData.NumberOfZip;
            if (TotalNumberOfZipFiles > 0)
            {
                AddEntity(HUDEntity.FileArrowEntity);
            }

            if (levelData.NumberOfDocumentFiles == 0)
            {
                //TotalNumberOfDocumentFiles = int.MaxValue;
            }
            else
            {
                TotalNumberOfDocumentFiles = levelData.NumberOfDocumentFiles;
            }
            if (levelData.TimeEndLevel > 0)
            {
                LevelAlarm = new Alarm(levelData.TimeEndLevel, TweenType.OneShot, ClearArea);
                BaseEntity e = new BaseEntity();
                e.AddTween(LevelAlarm, true);
                AddEntity(e);
            }

            foreach (BaseGenerator generator in levelData.Generator)
            {
                AddEntity(generator);
            }

            AddEntity(new PlayerEntity(levelData.StartPosition, GlobalVariables.TopPlayer, GlobalVariables.BottomPlayer));

            HUDEntity.GameScoreType = ScoreType.Points;
            OGE.CurrentWorld.AddOverLayer(new HUDEntity());
            CursorEntity.CursorView = CursorType.Aim;

            LevelNameAnnouncerEntity levelTitle = new LevelNameAnnouncerEntity(ShowTutorial, levelData.LevelName,
                GlobalVariables.CurrentLevel);
            levelTitle.TintColor = new Color(150, 255, 130);

            AddOverLayer(levelTitle);
        }