예제 #1
0
 public void LoadScreen(AvailableScreens pScreen)
 {
     if (m_bAllLoaded)
     {
         m_bAllLoaded = false;
         switch (pScreen)
         {
             case AvailableScreens.TITLE:
                 m_pScreenToLoad = new TitleScreen(this);
                 break;
             case AvailableScreens.HIGHSCORE:
                 m_pScreenToLoad = new HighScoreScreen(this);
                 break;
             case AvailableScreens.GAMEOVER:
                 m_pScreenToLoad = new GameOverScreen(this);
                 break;
             case AvailableScreens.GAMEPLAY:
                 m_pScreenToLoad = new GameplayScreen(this);
                 break;
             case AvailableScreens.MAINMENU:
                 m_pScreenToLoad = new MainMenuScreen(this);
                 break;
             case AvailableScreens.OPTIONS:
                 m_pScreenToLoad = new OptionsScreen(this);
                 break;
         }
         ThreadPool.QueueUserWorkItem(new WaitCallback(LoadScreenContent));
     }
     else
     {
         Console.WriteLine("SCREENS IS ALREADY LOADING! PLEASE WAIT");
     }
 }
예제 #2
0
 public ParticleEngine(Screen pParent)
 {
     m_pRandom = new Random();
 }
예제 #3
0
        private void LoadScreenContent(object pState)
        {
            if (m_pScreenToLoad != null)
            {
                m_pScreenToLoad.LoadContent(Content);
                m_pCurrentScreen = m_pScreenToLoad;
                m_pScreenToLoad = null;
            }

            m_bAllLoaded = true;
        }