tailieunhanh - Microsoft XNA Game Studio Creator’s Guide- P18
Microsoft XNA Game Studio Creator’s Guide- P18: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. | 488 MICROSOFT X N A GAME STUDIO CREATOR S GUIDE in a SoundEffect object. A SoundEffectInstance is created from this SoundEffect object which gives you the ability to loop pause and resume your individual sound effects. The firing audio is loaded into a SoundEffect object which is used later for playback whenever the B button is pressed. load and play background audio backgroundAudio Song Audio telemetricBeep backgroundAudio true load and play engine as SoundEffectInstance for playback control engineSound SoundEffect Audio engine0 engineinstance VOLUME PITCH PAN LOOP load fire sound effect for playback later fireSound SoundEffect Audio fire Lastly inside Update you can add this code to trigger the firing audio whenever the B button is pressed. This code will also allow your players to pause and resume the ship engine and telemetric beep whenever they press the center of the Zune pad. get new game pad states GamePadState gpCurrent play fire sound at each new B button press event if VOLUME PITCH PAN LOOP toggle engine audio pause and resume states for events if if else store game pad state for next frame gpPrevious gpCurrent You are now ready to deploy this to the Zune for an audio-enabled experience. You may have found the process so simple that you might also decide to use this library in your 2D and 3D game projects on the PC and Xbox 360 as well. CHAPTER 27 We are sure you will notice how much more enjoyable your games are when you add audio using any of the alternatives provided in XNA. Chapter 27 review exercises To get the most from this chapter .
đang nạp các trang xem trước