Add tap sounds for actions
This commit is contained in:
@@ -12,19 +12,22 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
private Vector3 _PrevPos;
|
||||
private Vector3 MaxSpeed = new Vector3(0.2f, 0.2f, 0.2f);
|
||||
public Vector3 Acceleration = new Vector3(0.002wf, 0.004f, 0.004f);
|
||||
public Vector3 Acceleration = new Vector3(0.0035f, 0.004f, 0.004f);
|
||||
private Vector3 Deceleration = new Vector3(0.0025f, 0.0025f, 0.0025f);
|
||||
private ISoundEffect sfxEngine;
|
||||
private ISoundEffect sfxWhine;
|
||||
private ISoundEffect sfxDamage;
|
||||
private SoundPatch sfxElevator;
|
||||
private SoundPatch sfxVacuum;
|
||||
private SoundPatch sfxTurn;
|
||||
private AudioAsset sfxTaps;
|
||||
public IWeapon CurrentWeapon;
|
||||
private int Turning;
|
||||
private int Elevating;
|
||||
public bool Vacuuming;
|
||||
public float Health;
|
||||
private Random rnd = new Random();
|
||||
private bool IsDamaged;
|
||||
public Player(IScreen screen): base(screen)
|
||||
{
|
||||
ShouldDestroy = false;
|
||||
@@ -56,7 +59,9 @@ namespace EvilSatellites.Objects
|
||||
sfxWhine.ConnectToEffect(Screen.Manager.EnvironmentEffect);
|
||||
sfxEngine.Play();
|
||||
sfxWhine.Play();
|
||||
|
||||
sfxDamage = Screen.Manager.Sound.Load(@"sfx/ui/alarmDamage.wav", false);
|
||||
sfxDamage.Loop = true;
|
||||
sfxTaps = new AudioAsset(Screen.Manager.Sound, @"sfx/ship/taps", 1, 20);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -131,6 +136,7 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
Turning = dir;
|
||||
sfxTurn.Start(time);
|
||||
PlayTap();
|
||||
}
|
||||
|
||||
public void StopTurning()
|
||||
@@ -143,6 +149,7 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
Elevating = dir;
|
||||
sfxElevator.Start(time);
|
||||
PlayTap();
|
||||
}
|
||||
|
||||
public void StopElevating()
|
||||
@@ -155,6 +162,7 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
Vacuuming = true;
|
||||
sfxVacuum.Start(time);
|
||||
PlayTap();
|
||||
}
|
||||
|
||||
public void StopVacuuming()
|
||||
@@ -166,6 +174,11 @@ namespace EvilSatellites.Objects
|
||||
public void TakeDamage(float dmg)
|
||||
{
|
||||
Health -= dmg;
|
||||
if (Health < 25 && !IsDamaged)
|
||||
{
|
||||
IsDamaged = true;
|
||||
sfxDamage.Play();
|
||||
}
|
||||
string dmgSound = @"sfx/physics/collisions/";
|
||||
if (dmg > 60)
|
||||
{
|
||||
@@ -180,5 +193,10 @@ namespace EvilSatellites.Objects
|
||||
dmgSound += "/int/" + (rnd.Next(2)+1).ToString()+".wav";
|
||||
Screen.Manager.Sound.PlayOneshot(dmgSound);
|
||||
}
|
||||
|
||||
public void PlayTap()
|
||||
{
|
||||
sfxTaps.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user