Game Development Reference
In-Depth Information
void ZeroAilerons(void)
{
Element[0].iFlap = 0;
Element[3].iFlap = 0;
}
RollLeft deflects the port aileron, located on the port wing section ( Element[0] ), up‐
ward, and the starboard aileron, located on the starboard wing section ( Element[3] ),
downward. RollRight does just the opposite, and ZeroAilerons resets the flaps back
to their undeflected positions.
We've defined yet another set of functions to control the aft elevators so as to control
pitch:
void PitchUp(void)
{
Element[4].iFlap = 1;
Element[5].iFlap = 1;
}
void PitchDown(void)
{
Element[4].iFlap = −1;
Element[5].iFlap = −1;
}
void ZeroElevators(void)
{
Element[4].iFlap = 0;
Element[5].iFlap = 0;
}
Element[4] and Element[5] are the elevators. PitchUp deflects their flaps upward, and
PitchDown deflects their flaps downward. ZeroElevators resets their flaps back to their
undeflected positions.
Finally, there are two more functions to control the landing flaps:
void FlapsDown(void)
{
Element[1].iFlap = −1;
Element[2].iFlap = −1;
Flaps = true;
}
void ZeroFlaps(void)
{
Element[1].iFlap = 0;
Element[2].iFlap = 0;
Search Nedrilad ::




Custom Search