tailieunhanh - Microsoft XNA Game Studio Creator’s Guide- P15
Microsoft XNA Game Studio Creator’s Guide- P15:The release of the XNA platform and specifically the ability for anyone to write Xbox 360 console games was truly a major progression in the game-programming world. Before XNA, it was simply too complicated and costly for a student, software hobbyist, or independent game developer to gain access to a decent development kit for a major console platform. | 98 MICROSOFT X N A GAME STUDIO CREATOR S GUIDE DrawFonts released line if Down DrawFonts pressed line else DrawFonts released line if Left DrawFonts pressed line else DrawFonts released line if Right DrawFonts pressed line else DrawFonts released line A - press center of Zune pad if A DrawFonts A pressed line else DrawFonts A released line B - press top right button if B DrawFonts B pressed line else DrawFonts B released line running finger on Zune pad float X thumbstick X float Y thumbstick Y DrawFonts line DrawFonts line DrawFonts line DrawFonts line show user how to exit game - back button is top left button line Back button is already used to exit in the template DrawFonts Press Back button line DrawFonts to exit. line With everything in place you can now trigger the code to display the input device status from Draw ShowInputDeviceStatus CHAPTER 23 99 When you run your code you will see the press and release states of your controls as well as the X and Y position of your finger on the Zune pad. You can see from this tiny example that Zune input handling is simple yet flexible enough to allow players a full range of control over their game play. After enabling keyboard mouse game pad and Zune input you literally will have placed control of your game engine in the hands of your players. Your world is now their oyster. Chapter 23 review exercises To get the most from this chapter try out these chapter review exercises. 1. Try the step-by-step examples provided in this chapter if you have not already done so. 2. If you run the solution from Exercise 1 when you left-click the mouse the word Pressed
đang nạp các trang xem trước