Bug fixes
This commit is contained in:
@@ -28,6 +28,8 @@ namespace EvilSatellites.Objects
|
||||
public float Health;
|
||||
private Random rnd = new Random();
|
||||
private bool IsDamaged;
|
||||
private double SpinTimer;
|
||||
private double IdleTimer;
|
||||
public Player(IScreen screen): base(screen)
|
||||
{
|
||||
ShouldDestroy = false;
|
||||
@@ -57,11 +59,14 @@ namespace EvilSatellites.Objects
|
||||
sfxWhine.Loop = true;
|
||||
sfxEngine.ConnectToEffect(Screen.Manager.EnvironmentEffect);
|
||||
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);
|
||||
sfxEngine.Play();
|
||||
sfxWhine.Play();
|
||||
SpinTimer = 0;
|
||||
IdleTimer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,6 +84,27 @@ namespace EvilSatellites.Objects
|
||||
}
|
||||
override public void Update(GameTime gameTime)
|
||||
{
|
||||
if (Turning != 0 || Elevating != 0)
|
||||
{
|
||||
SpinTimer += gameTime.ElapsedGameTime.TotalMilliseconds;
|
||||
if (SpinTimer > 4000)
|
||||
{
|
||||
Screen.Manager.Computer.Play("Spinning");
|
||||
SpinTimer = 0;
|
||||
}
|
||||
}
|
||||
if (Movement.Length() < 0.01 && Elevating == 0 && Turning == 0 && CurrentWeapon.State == WeaponState.Stopped)
|
||||
{
|
||||
IdleTimer += gameTime.ElapsedGameTime.TotalMilliseconds;
|
||||
if (IdleTimer > 30000)
|
||||
{
|
||||
Screen.Manager.Computer.Play("Still");
|
||||
IdleTimer = 0;
|
||||
}
|
||||
} else
|
||||
{
|
||||
IdleTimer = 0;
|
||||
}
|
||||
CurrentWeapon.Update(gameTime);
|
||||
Move(Movement);
|
||||
if (Turning == -1)
|
||||
@@ -154,6 +180,7 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
Turning = 0;
|
||||
sfxTurn.Stop();
|
||||
if (Elevating == 0) SpinTimer = 0;
|
||||
}
|
||||
|
||||
public void StartElevating(int dir, GameTime time)
|
||||
@@ -167,6 +194,7 @@ namespace EvilSatellites.Objects
|
||||
{
|
||||
Elevating = 0;
|
||||
sfxElevator.Stop();
|
||||
if (Turning == 0) SpinTimer = 0;
|
||||
}
|
||||
|
||||
public void StartVacuuming(GameTime time)
|
||||
@@ -232,10 +260,7 @@ namespace EvilSatellites.Objects
|
||||
|
||||
override public void OnCollision(IGameObject obj)
|
||||
{
|
||||
if (obj.Type == ObjectType.Debris)
|
||||
{
|
||||
Screen.Manager.Computer.Play("DamageDebris");
|
||||
}
|
||||
|
||||
if (obj.Type == ObjectType.Projectile)
|
||||
{
|
||||
var proj = (Projectile)obj;
|
||||
|
||||
Reference in New Issue
Block a user