//----------------------------------------------------------------------------- // 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(); }
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); } } }
//----------------------------------------------------------------------------- // 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; }