Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public LoadingGameScreen(LevelLoader Stage)
            : base()
        {
            this.Stage = Stage;
            // Flag that there is no need for the game to transition
            // off when the pause menu is on top of it.
            IsPopup = true;

            transOnTime = TimeSpan.FromSeconds(1);
            transOffTime = TimeSpan.FromSeconds(1);

            Temporary = true;
        }
Ejemplo n.º 2
0
        void LoadLevel(GameTime gameTime)
        {
            Game_State = GameState.MenuLoaded;
            LoadingComplete = false;
            Loading = false;

            if (Level_Loader != null)
            {
                Level_Loader.Stop();
            }

            if (loadWait > TimeSpan.FromSeconds(0.2d))
            {
                if (!LevelStat[LevelNum - 1].locked)
                {
                    LoadedResources = new ResourceList();
                    Level_Loader = new LevelLoader(this);
                    Level_Loader.LoadLevel(LevelNum);
                    Load_FrameCount = 0;
                    Game_State = GameState.LoadingLevel;
                    Loading = true;
                    LoadingComplete = false;
                    loadWait = TimeSpan.Zero;

                    if (loadingLevel != null)
                        if (loadingLevel.IsActive)
                            loadingLevel.ExitScreen();

                    loadingLevel = new LoadingGameScreen(Level_Loader);
                    loadingLevel.ScreenManager = screenManager;
                }
            }
            else
                loadWait += gameTime.ElapsedGameTime;
        }