Game Development Reference
In-Depth Information
Flaps = false;
}
The landing flaps are fitted on the inboard wings sections, port and starboard, which
are Element[1] and Element[2] . FlapsDown deflects the flaps downward, while Zero
Flaps resets them back to their undeflected position.
As we said, these functions should be called when the user is pressing the flight control
keys. Further, they need to be called before StepSimulation is called so that they can
be included in the current time step's force and moment calculations. The sequence of
calls should look something like this:
.
.
.
ZeroRudder();
ZeroAilerons();
ZeroElevators();
// pitch down
if (IsKeyDown(VK_UP))
PitchDown();
// pitch up
if (IsKeyDown(VK_DOWN))
PitchUp();
// roll left
if (IsKeyDown(VK_LEFT))
RollLeft();
// roll right
if (IsKeyDown(VK_RIGHT))
RollRight();
// Increase thrust
if (IsKeyDown(0x41)) // A
IncThrust();
// Decrease thrust
if (IsKeyDown(0x5A)) // Z
DecThrust();
// yaw left
if (IsKeyDown(0x58)) // x
LeftRudder();
// yaw right
if (IsKeyDown(0x43)) // c
RightRudder();
Search Nedrilad ::




Custom Search