Chapter 3: User Input and Collision Detection
Quiz Answers
What object is used to read input from a mouse?
Mouse.
Fact or fiction: the X and Y coordinates from a mouse as read in an XNA application represent how much the mouse has moved since the previous frame.
Fiction. The input is given in actual screen coordinates based off the upper-left corner of the game window. To get the distance moved since the previous frame, you have to compare the value from the current frame against the value of the previous frame.
What is the difference between an analog input control and a digital input control?
A digital input yields a Boolean yes/no, on/off status, while an analog input gives a range of inputs based on how far the button has been pressed.
Describe the bounding-box collision-detection algorithm.
The bounding-box algorithm is a simple collision-detection algorithm in which you "draw" imaginary boxes around objects and then run collision checks on the boxes themselves to see if any objects are colliding.
Describe the pros and cons of the bounding-box collision-detection algorithm.
The two biggest pros of the algorithm are its speed and simplicity. The biggest drawback is its inherent inaccuracy—not all objects are square or rectangular, and as such the algorithm has accuracy issues.
When George Costanza is about to announce that he will henceforth be known as "T-Bone," in one of the all-time classic Seinfeld episodes ("The Maid"), what does Mr. Kruger name him instead?
George: "OK, everybody. ...