Пример #1
0
        //public override void Transition()
        //{
        //    // update SpriteBatchMan()
        //    SpriteBatchMan.SetActive(this.poSpriteBatchMan);
        //}

        public override void Entering()
        {
            // update SpriteBatchMan()
            SpriteBatchMan.SetActive(this.poSpriteBatchMan);
            GameObjectMan.SetActive(this.poGameObjectMan);
            TimerMan.SetActive(this.poTimerMan);
            ShipMan.SetActive(this.poShipMan);
            DelayedObjectMan.SetActive(this.poDelayedObjectMan);

            // Update timer since last pause
            float t0    = GlobalTimer.GetTime();
            float t1    = this.TimeAtPause;
            float delta = t0 - t1;

            TimerMan.PauseUpdate(delta);
        }
Пример #2
0
        //-----------------------------------------------------------------------------
        // Game::Update()
        //      Called once per frame, update data, tranformations, etc
        //      Use this function to control process order
        //      Input, AI, Physics, Animation, and Graphics
        //-----------------------------------------------------------------------------


        public override void Update()
        {
            // Add your update below this line: ----------------------------
            //  stuff called every update no matter the scene here...
            //  example: like audio update


            GlobalTimer.Update(this.GetTime());

            // Hack to proof of concept...
            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_0) == true)
            {
                pSceneContext.SetState(SceneContext.Scene.Demo);
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_3) == true)
            {
                pSceneContext.SetState(SceneContext.Scene.Select);
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_1) == true)
            {
                pSceneContext.SetState(SceneContext.Scene.Play);
                Score.SetCurrentPlayer(1);
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_2) == true)
            {
                pSceneContext.SetState(SceneContext.Scene.Play);
                Score.SetCurrentPlayer(2);
            }

            if (Azul.Input.GetKeyState(Azul.AZUL_KEY.KEY_4) == true)
            {
                pSceneContext.SetState(SceneContext.Scene.GameOver);
            }



            // Update the scene
            (pSceneContext.GetState()).Update(this.GetTime());
        }
Пример #3
0
        public override void Entering()
        {
            // Make sure all of the game settings are inline
            Lives.ResetLives();
            Score.ResetPlayerScores();
            Level.Reset();


            // update
            SpriteNodeBatchManager.SetActive(this.poSpriteNodeBatchMan);
            GameObjectManager.SetActive(this.poGameObjectManager);
            InputManager.SetActive(this.poInputManager);


            // Update timer since last pause
            float t0    = GlobalTimer.GetTime();
            float t1    = this.TimeAtPause;
            float delta = t0 - t1;

            TimerManager.PauseUpdate(delta);
        }
Пример #4
0
        public static float GetTime()
        {
            GlobalTimer pTimer = GlobalTimer.privGetInstance();

            return(pTimer.mCurrTime);
        }
Пример #5
0
        //----------------------------------------------------------------------
        // Static Methods
        //----------------------------------------------------------------------

        public static void Update(float time)
        {
            GlobalTimer pTimer = GlobalTimer.privGetInstance();

            pTimer.mCurrTime = time;
        }
Пример #6
0
 public override void Leaving()
 {
     // Need a better way to do this
     this.TimeAtPause = GlobalTimer.GetTime();
 }
Пример #7
0
        //-----------------------------------------------------------------------------
        // Game::Update()
        //      Called once per frame, update data, tranformations, etc
        //      Use this function to control process order
        //      Input, AI, Physics, Animation, and Graphics
        //-----------------------------------------------------------------------------

        public override void Update()
        {
            GlobalTimer.Update(this.GetTime());

            SceneContext.GetState().Update(this.GetTime());
        }