Added sound effects and music.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using AlienAttack.MonoGame.Things.Bullets;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
|
||||
namespace AlienAttack.MonoGame.Things.Weapons;
|
||||
|
||||
@@ -20,6 +21,11 @@ public class Minigun : Weapon
|
||||
// Queue the bullets for spawning
|
||||
context.SpawnSprite(bullet1);
|
||||
context.SpawnSprite(bullet2);
|
||||
|
||||
int number = context.Random.Next(1, 7);
|
||||
|
||||
SoundEffect soundEffect = context.Content.Load<SoundEffect>(@$"Sfx\GUNAuto_Assault Rifle A Fire_0{number}_SFRMS_SCIWPNS");
|
||||
soundEffect.Play(0.25f, (float)(context.Random.NextDouble() * 0.1 - 0.05), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user