FUNDAMENTALS OF GAME DESIGN, SECOND EDITION
Flying
Flying presents a further complication because it involves moving through three dimensions whereas a two-dimensional input device such as a joystick offers control in only two. Control over movement in the third dimension must be handled by a separate mechanism, either extra controller buttons or an additional joystick. How you implement this depends on the nature of the aircraft itself, generally using the mechanisms in real aircraft as your model. Navigational controls in modern flying games are almost always intended for the first-person perspective from inside the cockpit. (See Chapter 17 for further details.)
The player maneuvers the aircraft using the joystick to pitch (the equivalent of a camera's tilt) or roll the aircraft, and the engine pulls the plane in the direction the nose faces. A throttle control, generally a slider or keys that increase and decrease the engine speed by fixed increments, sets the rate of forward movement. When flying straight and level, forward on the joystick pushes the nose down, producing descent, and back pulls the nose up, causing it to climb. Left on the joystick causes the plane to roll to the left while remaining on the same course; right rolls it to the right in the same manner. To turn in the horizontal plane, the pilot rolls the aircraft in the desired direction and pulls the joystick back at the same time, so the nose follows the direction of the roll, producing a banked turn. When the joystick returns to center, the plane should fly straight and level at a speed determined by the throttle.
Game user interfaces typically simplify helicopter navigation, which is more complicated than flying fixed-wing aircraft. The joystick controls turning and forward
or backward movement, and a slider control or keys cause the helicopter to ascend or descend. Left on the joystick causes the helicopter to turn counterclockwise about its vertical axis but not to actually go in that direction unless it is also moving forward. Right causes the equivalent rotation to the right. Forward propels the helicopter forward, and back the reverse. When the joystick returns to center, the helicopter should gradually slow down through air friction until it remains hovering above a fixed point in the landscape. A separate key set or slider controls vertical movement.
Most designers treat spacecraft as they would fixed-wing aircraft, although in one variant left or right on the joystick causes the vehicle to yaw (the equivalent of panning a camera), turning about its vertical axis to face in a different direction, rather than rolling.