Add tap sounds for actions

This commit is contained in:
2021-04-19 17:22:14 +02:00
parent 589124c5fc
commit faf3a38e93
24 changed files with 101 additions and 3 deletions
Binary file not shown.
+20 -2
View File
@@ -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();
}
}
}
+7
View File
@@ -106,6 +106,10 @@ namespace EvilSatellites.Screens
{
move.X = _player.Acceleration.X;
}
if (Input.IsJustPressed(Keys.A) || Input.IsJustPressed(Keys.S) || Input.IsJustPressed(Keys.D) || Input.IsJustPressed(Keys.W))
{
_player.PlayTap();
}
if (Input.IsJustPressed(Keys.Left))
{
_player.StartTurning(-1, gameTime);
@@ -142,6 +146,7 @@ namespace EvilSatellites.Screens
if (Input.IsJustPressed(Keys.Space))
{
_player.CurrentWeapon.Shoot(gameTime);
_player.PlayTap();
}
if (Input.IsJustReleased(Keys.Space))
{
@@ -149,6 +154,7 @@ namespace EvilSatellites.Screens
}
if (Input.IsJustPressed(Keys.R))
{
_player.PlayTap();
if (ObjectRadar.Active)
{
ObjectRadar.Stop();
@@ -159,6 +165,7 @@ namespace EvilSatellites.Screens
}
if (Input.IsJustPressed(Keys.T))
{
_player.PlayTap();
if (ObjectRadar.Filter == ObjectType.Satellite)
{
ObjectRadar.SetObjectType(ObjectType.Debris);
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9fc1a3aaf2ba7392e51fb0b07552d8a2d6e4f2fa3edfd38c7a2aa465841cdf7c
size 298330
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:50c1f5d265c92c48faad3527be9cdbd3264490d27ec13957ebae98068789cec1
size 316672
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e2a6f6cc9d5c1a8b3d9e52cef6df342201b23136be8cc47d43239db664e943f7
size 313852
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4c07bda07d89bc143896b0be5d54bcd858b33a4fc3424b7b8ef9dd5e9a8bebd
size 316672
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:29c8622b26e7f29b3a05f1f0dbd16ffa7d652aad22068231b8ec404d1c33f9f2
size 316672
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:15316535e23ae1af08413987d682f5d88ed0d7442da5ecba781cc37212dc2e3b
size 322318
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68ed08f51df07ec7789e7af24a19d0d203067037f434959e681ec8c738028323
size 316672
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:816f5c25f41a0cf579e2887aa0407fe1506361d2c7769ab404b85853c7970f72
size 313852
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a4bac6b51a5f85c041e688eeb98d250767a29d8ce00ebc045128022f76c55eb6
size 316672
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77a2d3cc8b742cfb5ca3e1b8c1402f2218aa8af6df0c7d9752b05434f684cb39
size 312442
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a7c136b79f07794ecb61e4f20850fb30552782e56855b62469b9ec193ca5fde
size 306088
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f707efd1374db5be1ce337c4a1a3318a58a93942804224522c75a58e8c691961
size 302560
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2232380f08345b695755110074067c5a538cdb5f20f72769e8f69e46619579fa
size 301150
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6fd611afbae79c5416e5a0fcef28f4f019027e12609d4edb49b56caab3ecb7b2
size 297976
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a0e8b5c39e15abe2e50eb87752d7aa0231a8f6acfb274f2f4dc6f8f215b2d82
size 309442
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b7cf8f2b04afb2687e7b9fcf17295cddd6a2972d2362bcfaae421fec9b27981
size 313852
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:10d16dd9149536f13077a68d39dbf2692a6528cbdb7115d7078748b9c0fa51c9
size 301150
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fd9f42c94478189272965f1bcbc28faa5b450d384c673f15f07e6be3f2d6aa6
size 300448
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:71fdb116a979e6a78f10e9ec798fcd16a95212f0ed457f28b4f45840798a22f0
size 311032
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2f80475b3f8d57e30e8016d25dd06d884851b7a0ac94c5ea59f116f08a1e89c4
size 313852
+14 -1
View File
@@ -1 +1,14 @@
Hits, Near misses, far misses, shoot into void, crash into debris left by shooting satellites, crash into random planet, low health, pick up ammo.
5 Hits, eg: "wow. good job."
5 Near misses, eg: "A near miss is indeed still a miss"
5 far misses, eg: "Um... it's over there."
3 shoot into void, eg: "I'll let you know if that ever actually hits something"
3 crash into debris left by shooting satellites, eg: "Now if only your shooting was as good as your ability to fly into crap"
5 low health, eg: "Why didn't I fly this thing instead"
5 pick up debris with vacuum to be turned into ammo, eg: "Ah yes. Someone's gotta clean up space junk after all"
Switch object radar to satellites, probably just: "satellites"
Switch object radar to debris, probably just: "debris"
3 game over, eg: "I'd love to say I had faith in you, but I mean... look where that would have gotten me"
possible ideas, not sure:
spin around without going anywhere, eg: "do you really enjoy cleaning your ship this much?"
staying still for a while, eg: "Did you fall asleep?"