Summary

  • Input devices supported in XNA include the keyboard, mouse, and Xbox 360 controller.

  • The Xbox 360 has several analog inputs that allow for varying degrees of input from a single button.

  • Collision detection is a constant balance between performance and accuracy. The more accurate an algorithm is, the more of a performance hit is usually incurred.

  • The bounding-box algorithm for collision detection is one of the most simple and straightforward algorithms. If you "draw" an imaginary box around each object, you can easily tell which box is colliding with another box.

  • You can speed up collision detection while improving accuracy by combining methods. Use a large box to determine if it's worth the time to check the smaller boxes surrounding sections of an object, or implement a grid-based system to avoid unnecessary collision checks between objects that are not close together.

  • Successfully implementing collision detection in XNA is like winning the Boston Marathon—except with no running, no sweating, no Boston, and no marathon.

Get Learning XNA 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.