Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A hypothetical game called “AlienShooter” needs to be able to work on Windows and on the Xbox. In the Windows version, the keyboard will handle firing at alien spaceships, and this functionality is contained within a method called “KeyboardSupport()”. In the Xbox version of the game, the gamepad will be used for shooting, and this functionality is contained within a method called “GamepadSupport()”. Write the statement(s) that must be added so that the appropriate code is used in the each version of the game.

share|improve this question

closed as unclear what you're asking by Anko, Kromster, Josh Petrie Aug 14 '15 at 15:14

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Really unclear. I had to look at the answer to figure out what the question was. – Anko Dec 9 '12 at 17:30
-1 You really couldn't even pose the question in your own words? Lack of research and I don't think "needing to do this homework problem" is "questions based on actual problems that you face." – Byte56 Dec 9 '12 at 18:33

Use the #if directive:

#elif XBOX

The following symbols are defined for use in cross-platform compilation: WINDOWS, XBOX or XBOX360 and WINDOWS_PHONE. See Cross-Platform Conditional Compilation Symbols for further information.

share|improve this answer
@NikoDrašković I edited my answer to make it clearer. Thank you for your suggestion. – Asakeron Dec 9 '12 at 18:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.