Beispiel #1
0
        protected override void Initialize()
        {
            InitMap();
            //currentScreen = new Screens.Maps.PlayingScreen(this);
            //currentScreen = new Screens.MapListScreen(this, mapsList);
            //pauseScreen = new PauseScreen(this);

            // Components.Add(pauseScreen);
            // pauseScreen.Enabled = false;
            //pauseScreen.Visible = false;

            currentScreen = new Screens.LoadingScreen(this);
            Components.Add(currentScreen);

            base.Initialize();
        }
Beispiel #2
0
        public void ChangeState()
        {
            if (!currentScreen.isActived)
            {
                if (currentScreen is Screens.LoadingScreen)
                {
                    Components.Clear();
                    currentScreen = new Screens.IntroScreen(this);
                    Components.Add(currentScreen);
                }
                else if (currentScreen is Screens.IntroScreen)
                {
                    Components.Clear();
                    currentScreen = new Screens.MenuScreen(this);
                    Components.Add(currentScreen);
                }
                else if (currentScreen is Screens.MenuScreen)
                {
                    if (currentScreen.nextState == ScreenState.NEWGAME)
                    {
                        Components.Clear();

                        currentScreen = new Screens.MapListScreen(this, mapsList, 0);
                        currentMap    = 0;
                        Components.Add(currentScreen);
                    }
                    else if (currentScreen.nextState == ScreenState.CONTINUE)
                    {
                        Components.Clear();
                        currentScreen = new Screens.MapListScreen(this, mapsList, currentMap);
                        Components.Add(currentScreen);
                    }
                }
                else if (currentScreen is Screens.MapListScreen)
                {
                    if (currentScreen.nextState == ScreenState.VEMENU)
                    {
                        Components.Clear();
                        currentScreen = new MenuScreen(this);
                        Components.Add(currentScreen);
                    }
                    else if (currentScreen.nextState == ScreenState.SANGCHOI)
                    {
                        Components.Clear();
                        //currentScreen = mapsList[currentScreen.selectedMap];
                        switch (currentScreen.selectedMap)
                        {
                        case 0:
                            currentScreen = new Screens.Maps.Map1(this);
                            break;

                        case 1:
                            currentScreen = new Screens.Maps.Map2(this);
                            break;

                        case 2:
                            currentScreen = new Screens.Maps.Map3(this);
                            break;

                        case 3:
                            currentScreen = new Screens.Maps.Map4(this);
                            break;

                        case 4:
                            currentScreen = new Screens.Maps.Map5(this);
                            break;

                        case 5:
                            currentScreen = new Screens.Maps.Map6(this);
                            break;
                        }
                        Components.Add(currentScreen);
                    }
                }
                else if (currentScreen is Screens.Maps.Map)
                {
                    //Components.Clear();
                    if (pauseScreen == null || pauseScreen.currentState != ScreenState.EXIT)
                    {
                        pauseScreen = new PauseScreen(this, currentScreen, mapsList, currentMap);
                        Components.Add(pauseScreen);
                    }
                }
            }
            if (pauseScreen != null && pauseScreen.isActived == false && pauseScreen.nextState == ScreenState.NEWGAME)
            {
                Components.Clear();
                currentScreen = new Screens.MapListScreen(this, mapsList, currentMap);
                Components.Add(currentScreen);

                pauseScreen.nextState = ScreenState.KHONGDOI;
            }
        }