Example #1
0
        private void _init()
        {
            _setUpSFML();

            //resource-ok betöltése (font-ok és textúrák, képek a játékhoz)
            appAssets.LoadResources(Constants.FONT_NAMES);

            m_DeltaTime    = 0.0;
            m_StepTime     = 1.0 / 60.0;
            m_MaxDeltaTime = 0.25; //0.25f
            m_Accumulator  = 0.0;
            m_Time         = 0.0;
            m_FPS          = 0.0;

            m_Timer = new AppTimer();
            //ChangeGameState( new GameScene(this) );

            fpsUpdater = new cRegulator();
            fpsUpdater.resetByPeriodTime(1.0f);


            //Idő szöveg
            timeText               = new Text("", appAssets.GetFont("pf_tempesta_seven"));
            timeText.Position      = new Vector2f(this.defaultView.Size.X - 500, 30);
            timeText.CharacterSize = 28; // in pixels, not points!
            timeText.FillColor     = Color.White;
            timeText.Style         = Text.Styles.Bold;

            GlobalClock.Start();

            // currentState = new GameScene(this);
            // currentState.Enter();

            m_AppRunning = true;

            definiedStates.Add("main-menu", () => { this.SetGameState(new MainMenu(this)); });
            definiedStates.Add("game-scene", () => { this.SetGameState(new GameScene(this)); });

            this.ChangeGameState("main-menu");
        }