Game Development Reference
In-Depth Information
make a touch-sensitive device's cursor return to a neutral position whenever you
detect that the player has stopped touching the device. Touch-sensitive screens may
be manipulated by the fingers or a stylus; touch pads usually cannot detect a stylus,
and must be touched with the fingers, which tends to make fingers sore after long use.
Early touch-sensitive screens could only detect one touch at a time, but the Apple
iPhone has perfected the multi-touch interface, which allows the user to touch it in
several locations at once. This is likely to become increasingly common on new
handheld devices. The problem of sore fingers after extended play remains.
One-Dimensional Input Devices
One-dimensional input devices send a single value to the game. Ordinary control-
ler buttons and keys send binary values; knobs, sliders, and pressure-sensitive
buttons send analog values.
CONTROLLER BUTTONS AND KEYS
A controller button or a keyboard key sends a single binary value at a time: on when
pressed and off when released. Despite this simplicity, you can use buttons and
keys in a variety of ways:
One-shot actions. Treat the on signal as a trigger, a message to the game to per-
form some action immediately (ignoring the off signal). The action occurs only
once, when the player presses the button; to perform it twice, he must press the
button again. You might use this to let players fire a handgun, firing once each
time they hit the button.
Repeating actions. The on signal tells the game to begin some action and to
repeat it until it receives the off signal from the same button at a repetition rate
determined by the software. You could let the players fire a machine gun continu-
ously from button press to button release.
Continuous actions. The button's on signal initiates a continuous action, and its
off signal ends it. Golf games use this to give a player control over how hard the
golfer swings the club; the player presses the button to start the golfer's backswing
and releases the button to begin the swing itself; the longer the backswing, the
harder the golfer hits the ball. Some football games allow the player to tap the but-
ton quickly to throw a short pass or to hold it down for a moment before release to
throw a long pass, with the length of time between a button's on and off signals
determining the distance thrown.
Console game controllers feature anywhere from one to about ten buttons. Buttons
on the top face of the controller, to be pressed with the thumbs, are known as face
buttons . Others, known as shoulder buttons , appear on the part of the controller facing
away from the player, under the index fingers. Faced with large numbers of buttons,
the player can find it quite difficult to remember what they all do. Here, as elsewhere,
be sure to maintain consistency from one gameplay mode to another, and if an
Search WWH ::




Custom Search