More accurate and reliable submarine-level collisions, looping OnUse sounds bugfix, new music clips, item sprites removed from limbs when someone else loots the item, Camera.WorldView fix, checking vector.LengthSquared before normalizing to avoid creating a NaN vector

This commit is contained in:
Regalis
2015-10-04 23:50:46 +03:00
parent 0be4ad4f84
commit f13a48ef52
33 changed files with 342 additions and 217 deletions

View File

@@ -47,6 +47,13 @@ namespace Subsurface
entity.IsHighlighted = false;
}
public override void Deselect()
{
base.Deselect();
Sounds.SoundManager.LowPassHFGain = 1.0f;
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
@@ -60,16 +67,16 @@ namespace Subsurface
AmbientSoundManager.Update();
//if (Game1.GameSession != null && Game1.GameSession.Level != null)
//{
// Vector2 targetMovement = Vector2.Zero;
// if (PlayerInput.KeyDown(Keys.I)) targetMovement.Y += 1.0f;
// if (PlayerInput.KeyDown(Keys.K)) targetMovement.Y -= 1.0f;
// if (PlayerInput.KeyDown(Keys.J)) targetMovement.X -= 1.0f;
// if (PlayerInput.KeyDown(Keys.L)) targetMovement.X += 1.0f;
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
{
Vector2 targetMovement = Vector2.Zero;
if (PlayerInput.KeyDown(Keys.I)) targetMovement.Y += 1.0f;
if (PlayerInput.KeyDown(Keys.K)) targetMovement.Y -= 1.0f;
if (PlayerInput.KeyDown(Keys.J)) targetMovement.X -= 1.0f;
if (PlayerInput.KeyDown(Keys.L)) targetMovement.X += 1.0f;
// Game1.GameSession.Submarine.ApplyForce(targetMovement * 100000.0f);
//}
GameMain.GameSession.Submarine.ApplyForce(targetMovement * 100000.0f);
}
if (GameMain.GameSession!=null) GameMain.GameSession.Update((float)deltaTime);
//EventManager.Update(gameTime);
@@ -99,7 +106,7 @@ namespace Subsurface
Ragdoll.UpdateAll(cam, (float)Physics.step);
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
if (GameMain.GameSession != null && GameMain.GameSession.Level != null && GameMain.GameSession.Submarine!=null)
{
GameMain.GameSession.Submarine.Update((float)Physics.step);
}