Add weapons and engine to environmental effects

This commit is contained in:
2021-04-15 01:30:13 +02:00
parent 3e5809a98e
commit d99cbe3211
5 changed files with 23 additions and 3 deletions
Binary file not shown.
Binary file not shown.
+2
View File
@@ -37,6 +37,8 @@ namespace EvilSatellites.Objects
sfxWhine = Screen.Manager.Sound.Load(@"sfx/engine/int/engineWhine.wav", false); sfxWhine = Screen.Manager.Sound.Load(@"sfx/engine/int/engineWhine.wav", false);
sfxEngine.Loop = true; sfxEngine.Loop = true;
sfxWhine.Loop = true; sfxWhine.Loop = true;
sfxEngine.ConnectToEffect(Screen.Manager.EnvironmentEffect);
sfxWhine.ConnectToEffect(Screen.Manager.EnvironmentEffect);
sfxEngine.Play(); sfxEngine.Play();
sfxWhine.Play(); sfxWhine.Play();
+1 -1
View File
@@ -26,7 +26,7 @@ namespace EvilSatellites
EnvironmentEffect = Sound.CreateReverb(); EnvironmentEffect = Sound.CreateReverb();
EnvironmentEffect.Delay = 0.03; EnvironmentEffect.Delay = 0.03;
EnvironmentEffect.Wet = 30; EnvironmentEffect.Wet = 30;
EnvironmentEffect.T60 = 3.3; EnvironmentEffect.T60 = 5;
EnvironmentEffect.Defusion = 1; EnvironmentEffect.Defusion = 1;
EnvironmentEffect.FreePath = 0.22; EnvironmentEffect.FreePath = 0.22;
+20 -2
View File
@@ -37,10 +37,19 @@ namespace EvilSatellites.Weapons
sfxSpinning = Screen.Manager.Sound.Load(@"sfx/weapons/LaserMG/spinning.wav", false); sfxSpinning = Screen.Manager.Sound.Load(@"sfx/weapons/LaserMG/spinning.wav", false);
sfxSpinning.Loop = true; sfxSpinning.Loop = true;
sfxShoot = new AudioAsset(Screen.Manager.Sound, @"sfx/weapons/LaserMG/fire", 1, 4); sfxShoot = new AudioAsset(Screen.Manager.Sound, @"sfx/weapons/LaserMG/fire", 1, 4);
sfxReload.ConnectToEffect(Screen.Manager.EnvironmentEffect);
sfxShoot.AddEffect(Screen.Manager.EnvironmentEffect);
sfxSpindown.ConnectToEffect(Screen.Manager.EnvironmentEffect);
sfxSpinup.ConnectToEffect(Screen.Manager.EnvironmentEffect);
sfxSpinning.ConnectToEffect(Screen.Manager.EnvironmentEffect);
} }
public override void Shoot(GameTime time) public override void Shoot(GameTime time)
{ {
if (State != WeaponState.Stopped)
{
return;
}
State = WeaponState.Starting; State = WeaponState.Starting;
sfxSpinup.Reset(); sfxSpinup.Reset();
sfxSpinup.Play(); sfxSpinup.Play();
@@ -49,12 +58,13 @@ namespace EvilSatellites.Weapons
public override void Stop() public override void Stop()
{ {
if (State == WeaponState.Firing) if (State != WeaponState.Stopped)
{ {
sfxSpinning.Pause(); sfxSpinning.Pause();
sfxSpinup.Pause();
sfxSpindown.Reset(); sfxSpindown.Reset();
sfxSpindown.Play(); sfxSpindown.Play();
State = WeaponState.Stopped; State = WeaponState.Stopping;
} }
} }
@@ -80,6 +90,14 @@ namespace EvilSatellites.Weapons
Screen.AddObject(proj); Screen.AddObject(proj);
} }
} }
if (State == WeaponState.Stopping)
{
if (TimerEnd - TimerStart > 500)
{
State = WeaponState.Stopped;
TimerStart = TimerEnd;
}
}
base.Update(time); base.Update(time);
} }