Exemplo n.º 1
0
 /// <summary>
 /// Runs the sound effect
 /// </summary>
 /// <param name="objects">List of objects in the game</param>
 /// <param name="player">Player</param>
 public override void RunTrigger(List<GameObject> objects, Player player)
 {
     if (player.IsCollidingCircleandCircle(this)&&!_playing)
     {
         _soundByte.Play();
         _playing = true;
     }
     else if (!player.IsCollidingCircleandCircle(this))
         _playing = false;
 }
Exemplo n.º 2
0
 public override void RunTrigger(List<GameObject> objects, Player player)
 {
     if (player.IsCollidingCircleandCircle(this) && _musicByteInstance.State != SoundState.Playing)
     {
         GameSound.StopOthersAndPlay(_musicByteInstance);
         GameSound.SetGeneric(_musicByteInstance);
     }
 }