Esempio n. 1
0
        protected override void OnUpdate(float timeStep)
        {
            base.OnUpdate(timeStep);

            network.Update();

            SimpleMoveCamera3D(timeStep);

            const int qualShift = 1;

            if (Input.GetKeyPress(Key.P))
            {
                simulation.DumpGameLog(new FileStream(@"C:\Log\" + Math.Abs(Contexts.sharedInstance.gameState.hashCode.value) + ".bin", FileMode.Create, FileAccess.Write));
            }

            // Set destination or spawn a new jack with left mouse button
            if (Input.GetMouseButtonPress(MouseButton.Left))
            {
                SetPathPoint(Input.GetQualifierDown(qualShift));
            }

            simulation.Update(timeStep * 1000);

            if (simulation.Running)
            {
                worldInfoText.Value = "ActorId: " + simulation.LocalActorId + Environment.NewLine +
                                      "Tick: " + Contexts.sharedInstance.gameState.tick.value + Environment.NewLine +
                                      "HashCode: " + Contexts.sharedInstance.gameState.hashCode.value;
            }
        }
        public void TickFixed(float dt)
        {
            network.Update();

            if (!Running)
            {
                return;
            }
            gameState.tick++;

            ExecuteCommand();
        }