QA


Q&A

Q1:

What's a trip rectangle, and why is it really necessary?

A1:

A trip rectangle is a rectangle that provides a means of simplifying and improving joystick input so that a joystick isn't too sensitive. More specifically , a trip rectangle is calculated to be proportionally smaller than the rectangle that represents the range of motion for a traditional XY joystick. In terms of simplicity, a trip rectangle makes it possible to consider joystick input in terms of a direction (left, right, up, down), as opposed to an XY coordinate value. A trip rectangle is also valuable because it prevents a joystick from feeling overly sensitive, where every time you touch it movement is interpreted. A trip rectangle basically establishes a minimum threshold of movement that the joystick handle must pass beyond before a joystick movement event is generated.

Q2:

Why doesn't the code in this hour support more than one joystick?

A2:

The joystick code developed throughout this hour supports only one joystick purely for the sake of simplicity. The code added to the game engine would be somewhat more complex if it were to support multiple joysticks, so I opted to keep it simple and focus on supporting a single joystick. In order to support multiple joysticks, you would primarily need to manage the multiple IDs associated with the joysticks, which isn't terribly difficult. In other words, you should have enough knowledge to add support for multiple joysticks to the game engine.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net