Understanding Tablet Input Options

To understand your options, you need to know what tablets offer in terms of gathering data about the user’s actions. Following is a fairly comprehensive list of the sensors that exist in many tablets. Some tablets don’t have all of these, whereas others have additional ones:

  • Touchscreen: Most tablets have a multitouch interface that lets you use input from several fingers on the screen at one time. The accurate screens now let you create very small sprites and still enable the user to drag them around due to the screens’ precision. For the majority of games, this is the method of user control. Nearly every game needs this for its menus at the very least.
  • Microphone: Tablets running Android 3.0 often have a built-in microphone that can be used as input. Examples include altering the height of a helicopter based on either the pitch or the volume of the sound sampling. Although this has many interesting applications, it isn’t used in most games.
  • Accelerometer: This sensor measures changes in orientation of a tablet. You may be familiar with this when you rotate your tablet from landscape to portrait view: the screen generally adjusts itself based on data from an accelerometer. In flight games and racing games, this is a fun way to let the user control their vehicle.
  • Gyroscope: Similar to the accelerometer, a gyroscope measures the rate of turns along the three axis of movement. This is used for precise motion and can tell you the exact patterns of rotation. Games that use the accelerometer can also use a gyroscope.
  • Proximity: A proximity sensor measures an object’s distance from the phone. Often these are imprecise and are used primarily to turn off a screen if it’s close to your cheek (when you’re making a call with a touchscreen phone). Very few games use this, however.

Although this list includes most of the ways for a game to gather data from the player, you can access other sensors that describe the player’s area and surroundings. This is no substitute for user interaction, but it adds realism to a game. Following are the ways most tablets provide to get this information:

  • GPS: The GPS location of a device can let the game map be an image of the surrounding area or can change the scenery or characters of a game. It’s impossible to take into account all the various locations that a device can be in, but later you examine ways to incorporate this.
  • Ambient light: This sensor is primarily used to adjust the brightness of the screen depending on the external light, but it does offer some advantages to game developers. One way to incorporate it is to change the game to a night scene if the user is in a dark place.
  • Barometer: This sensor is more of a joke than anything. But in reality, a game could potentially use it to approximate the altitude and adjust the game accordingly. I haven’t yet seen a game integrate this sensor successfully.

Knowing the various internal sensors you can expect to find on a tablet, you can also begin to think about additional input devices you might want to connect to it. Android 3.0 comes with the best support for Bluetooth input of any Android version. Each new release will likely continue to expand this. Although Bluetooth input may be exciting, the point of writing games for a tablet is to provide users with a unique experience. If they still must connect their game console, then they may as well use a television. With that being said, Android now has native support for joysticks, keyboards, and game controllers.

images Note With the advent of televisions that run a hybrid of the Android and Chrome operating systems, it’s becoming possible to use a tablet as a controller. Connecting a tablet to a TV that runs Android allows the television screen to display the game while the tablet doubles as a map and controller. The more widely Android is used to power devices, the more opportunities you have in terms of input.

You’re almost ready to get your hands dirty setting up some input for your games. First, however, you go over some of the theory behind gathering input. Getting input quickly is critical to a game, whereas a traditional application (a map or an address book, for example) doesn’t require this speed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.73.187