Lots of stuff

This commit is contained in:
2021-04-19 15:41:37 +02:00
parent 3d9ca3d590
commit 589124c5fc
10 changed files with 120 additions and 24 deletions
+10 -3
View File
@@ -32,9 +32,16 @@ namespace EvilSatellites.Objects
{
ShouldDestroy = false;
Active = true;
Sound = Screen.Manager.Sound.Load3D(@"sfx/bullets/1.wav");
Sound.Loop = true;
Sound.Play();
Sound.Pitch = 0.9 + rnd.NextDouble()*0.3;
Sound.Position = new System.Numerics.Vector3(Position.X+Dimensions.X/2, Position.Y+Dimensions.Y/2, Position.Z+Dimensions.Z/2);
}
public override void Destroy()
{
Sound.Stop();
Sound.Destroy();
ShouldDestroy = true;
Active = false;
}
@@ -46,13 +53,13 @@ namespace EvilSatellites.Objects
{
Destroy();
}
Sound.Position = new System.Numerics.Vector3(Position.X + Dimensions.X / 2, Position.Y + Dimensions.Y / 2, Position.Z + Dimensions.Z / 2);
}
public override void OnCollision(IGameObject obj)
{
if (obj.Type == ObjectType.Projectile) return;
if (obj.Type == ObjectType.Player) return;
Screen.Manager.Sound.PlayOneshot(@"sfx/physics/impacts/bullet/"+(rnd.Next(5)+1)+".wav", new System.Numerics.Vector3(Position.X, Position.Y, Position.Z), Screen.Manager.EnvironmentEffect);
if (obj.Type == ObjectType.Projectile || obj.Type == ObjectType.Player || obj.Type == ObjectType.Debris) return;
Screen.Manager.Sound.PlayOneshot(@"sfx/physics/impacts/bullet/"+(rnd.Next(5)+1)+".wav", new System.Numerics.Vector3(Position.X+Dimensions.X/2, Position.Y+Dimensions.Y/2, Position.Z+Dimensions.Z/2), Screen.Manager.EnvironmentEffect);
Destroy();
}
}