Esempio n. 1
0
        private void _init()
        {
            _setUpSFML();

            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 cTimer();
            //ChangeGameState( new cGameScene(this) );

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


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

            cGlobalClock.Start();

            m_CurrentState = new cGameScene(this);
            m_CurrentState.Enter();

            m_AppRunning = true;
        }
Esempio n. 2
0
        public void ChangeGameState(cGameScene new_state)
        {
            if (m_CurrentState != null)
            {
                m_CurrentState.Exit();
            }

            //m_LastState = m_CurrentState;
            m_CurrentState = new_state;
            m_CurrentState.Enter();
        }