C# - GIAD Base Class - #xna
Submitted by edg3 on Fri, 06/04/2010 - 08:51
namespace GIADBase { class GIADBaseClass { //make a constructor if you need one public GIADBaseClass(KeyboardHandler keyboardHandler) { //Add the A key to the list of keys we check the length they are pressed for //keyboardHandler.AddKey(Keys.A); } //load content method public void Load(ContentManager Content, SoundHandler soundHandler) { //add some sound effect //soundHandler.AddSoundEffect("somepath", Content.Load<SoundEffect>("somepath")); } //update method public void Update(GameTime gameTime, KeyboardHandler keyboardHandler, SoundHandler soundHandler) { //play some sound effect with full game volume, no pitch and no pan: //soundHandler.PlaySoundEffect("somepath", 1.0f, 0.0f, 0.0f); } //draw method public void Draw(SpriteBatch spriteBatch) { } } }