Added sound effects and music.

This commit is contained in:
2025-12-22 21:55:46 -05:00
parent 42608a16e3
commit 874c263910
36 changed files with 566 additions and 76 deletions

View File

@@ -3,6 +3,7 @@ using AlienAttack.MonoGame.Things.Enemies;
using AlienAttack.MonoGame.Things.Items;
using AlienAttack.MonoGame.Things.Weapons;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
@@ -331,6 +332,13 @@ internal class Player : MoveableSprite
if (context.Sprite is Shields)
{
//SCIEnrg_Shield Activate_01_SFRMS_SCIWPNS
int number = context.Random.Next(1, 6);
SoundEffect soundEffect = context.Content.Load<SoundEffect>(@$"Sfx\Shield\SCIEnrg_Shield Activate_0{number}_SFRMS_SCIWPNS");
soundEffect.Play(0.85f, (float)(context.Random.NextDouble() * 0.1 - 0.05), 0);
GiveShield(20);
}