Exemple #1
0
 public void OnFrameMove(Microsoft.DirectX.Direct3D.Device device, double totalTime, float elapsedTime)
 {
     if (towplane != null)
     {
         towplane.OnFrameMove(device, totalTime, elapsedTime);
     }
 }
 public void OnFrameMove(Microsoft.DirectX.Direct3D.Device device, double totalTime, float elapsedTime)
 {
     for (int i = 0; i < recordedFlights.Count; i++)
     {
         RecordedFlight flight = recordedFlights[i];
         flight.OnFrameMove(device, totalTime, elapsedTime);
     }
 }
Exemple #3
0
        public void OnFrameMove(Microsoft.DirectX.Direct3D.Device device, double totalTime, float elapsedTime)
        {
            if (prevFlapsChannel == 0)
            {
                prevFlapsChannel = owner.InputManager.GetAxisValue("flaps");
            }
            if (prevGearChannel == 0)
            {
                prevGearChannel = owner.InputManager.GetAxisValue("gear");
            }
            int flapsChannel = owner.InputManager.GetAxisValue("flaps");
            int gearChannel  = owner.InputManager.GetAxisValue("gear");

            if (((owner.InputManager.KeyBoardState != null) && (owner.InputManager.KeyBoardState[Microsoft.DirectX.DirectInput.Key.Space])) ||
                (Math.Abs(gearChannel - prevGearChannel) > 50) || (Math.Abs(flapsChannel - prevFlapsChannel) > 50))
            {
                Stop();
            }
            recordedFlight.OnFrameMove(device, totalTime, elapsedTime);
            if (scheduledMessages.Count > 0)
            {
                double messageTime = scheduledMessages[0].Time;
                if (messageTime < recordedFlight.Time)
                {
                    Program.Instance.CenterHud.ShowGameText(scheduledMessages[0].Message, scheduledMessages[0].Duration);
                    scheduledMessages.RemoveAt(0);
                }
            }

            if ((recordedFlight.Time % 40 > 10) && (previousFlightTime % 40 < 10))
            {
                Program.Instance.SwitchToCinematicCamera();
            }
            else if ((recordedFlight.Time % 40 > 30) && (previousFlightTime % 40 < 30))
            {
                Program.Instance.SwitchToObserverCamera();
            }
            previousFlightTime = recordedFlight.Time;
        }