Пример #1
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            PhysicWorld.Instance();
            GameManager.Instance();
            ParticleSpawner.Instance();
            AudioManager.Instance();
            InputQueue.Instance();
            OutputQueue.Instance();
            MyClient.Instance();

            prevTime = GetTime();

            GameManager.Start();
        }
Пример #2
0
        public static void Process()
        {
            while (instance.pOutputQueue.Count > 0)
            {
                DataMessage msg = instance.pOutputQueue.Dequeue();

                if (msg.sendType == SEND_TYPE.LOCAL)
                {
                    InputQueue.AddToQueue(msg);
                }
                else
                {
                    //InputQueue.AddToQueue(msg);
                    MyClient.Instance().SendData(msg);
                }
            }
        }
Пример #3
0
        //-----------------------------------------------------------------------------
        // Game::Update()
        //      Called once per frame, update data, tranformations, etc
        //      Use this function to control process order
        //      Input, AI, Physics, Animation, and Graphics
        //-----------------------------------------------------------------------------

        // static int number = 0;
        public override void Update()
        {
            float curTime         = GetTime();
            float gameElapsedTime = curTime - prevTime;

            PhysicWorld.Update(gameElapsedTime);
            GameManager.Update(gameElapsedTime);

            InputManager.Update();
            InputTest.KeyboardTest();

            MyClient.Instance().Update();

            OutputQueue.Process();
            InputQueue.Process();



            GameManager.CleanUp();

            prevTime = curTime;
        }