1 / 2

Sound Effects

Sound Effects. Managing Sound Events. Song spacesound; SoundEffect bonk; int soundtime; soundtime = 0; spacesound = Content.Load< Song >( "scifi026" ); bonk = Content.Load< SoundEffect >( "scifi034" ); MediaPlayer .IsRepeating = true ; MediaPlayer .Play(spacesound);

andren
Download Presentation

Sound Effects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sound Effects

  2. Managing Sound Events Song spacesound; SoundEffect bonk; int soundtime; soundtime = 0; spacesound = Content.Load<Song>("scifi026"); bonk = Content.Load<SoundEffect>("scifi034"); MediaPlayer.IsRepeating = true; MediaPlayer.Play(spacesound); if (x > maxX || x < minX) { vx *= -1; bonk.Play(spritescale.X / (float)3.0, (float)1.0, (float)0.0); } if (y > maxY || y < minY) { vy *= -1; bonk.Play(spritescale.X / (float)3.0, (float)1.0, (float)0.0); } spritescale.X *= (float)vscale; spritescale.Y *= (float)vscale; if (spritescale.X < 0.1 || spritescale.X > 2.5) { vscale = 1.0 / vscale; bonk.Play(spritescale.X / (float)3.0, (float)1.0, (float)0.0); } soundtime += gameTime.ElapsedGameTime.Milliseconds; if (soundtime > soundframetime) { MediaPlayer.Volume = spritescale.X / (float)3.0; soundtime = 0; } global declarations initialization loading contect updates

More Related