Пример #1
0
        void InitContentCore()
        {
            Content = new GameContent(Device, OpeningContent, Params);

            m_input = new InputWorker();
            m_timer = new TickTimer();

            m_profile = new Profile(Params.ProfileDir);
            m_profile.LoadProfileData();

            m_screenManager = new ScreenManager();

            m_screenCanvas = new DefaultCanvas(Device, false);
            m_screenCanvas.View.SetColor(OpeningContent.BackgroundColor);

            m_background = new SignalBackground();
            m_background.AddToCanvas(m_screenCanvas);

            m_loadingScreen = new LoadingScreen(Device)
            {
                Visible = false
            };
            m_loadingScreen.AddToCanvas(m_screenCanvas);

            m_field = new Field(Device)
            {
                Visible = false
            };
            m_field.VisibleChanged   = ((bool fieldVisible) => m_background.Visible = !fieldVisible);
            m_field.MenuButton.Click = (() => m_screenManager.ModalScreenFront(m_inGameMenu, m_field));
            m_field.Complete         = DelayedLevelComplete;
            m_field.AddToCanvas(m_screenCanvas);

            if (Params.ShowFps)
            {
                m_fpsCounter = new TextSpriteWithShadow(Content.Fonts.FieldStatusFont);
                m_screenCanvas.Add(m_fpsCounter);
            }

            PrepareMainMenu();
            PrepareSelectLevelMenu();
            PrepareInGameMenu();
            PrepareLevelCompleteMenu();

            PrepareInput();

            PrepareComponents();
        }