partial void Splash(Limb limb, Hull limbHull) { //create a splash particle GameMain.ParticleManager.CreateParticle("watersplash", new Vector2(limb.Position.X, limbHull.Surface) + limbHull.Submarine.Position, new Vector2(0.0f, Math.Abs(-limb.LinearVelocity.Y * 20.0f)), 0.0f, limbHull); GameMain.ParticleManager.CreateParticle("bubbles", new Vector2(limb.Position.X, limbHull.Surface) + limbHull.Submarine.Position, limb.LinearVelocity * 0.001f, 0.0f, limbHull); //if the Character dropped into water, create a wave if (limb.LinearVelocity.Y < 0.0f) { if (splashSoundTimer <= 0.0f) { SoundPlayer.PlaySplashSound(limb.WorldPosition, Math.Abs(limb.LinearVelocity.Y) + Rand.Range(-5.0f, 0.0f)); splashSoundTimer = 0.5f; } } }
partial void Splash(Limb limb, Hull limbHull) { //create a splash particle for (int i = 0; i < MathHelper.Clamp(Math.Abs(limb.LinearVelocity.Y), 1.0f, 5.0f); i++) { var splash = GameMain.ParticleManager.CreateParticle("watersplash", new Vector2(limb.WorldPosition.X, limbHull.WorldSurface), new Vector2(0.0f, Math.Abs(-limb.LinearVelocity.Y * 20.0f)) + Rand.Vector(Math.Abs(limb.LinearVelocity.Y * 10)), Rand.Range(0.0f, MathHelper.TwoPi), limbHull); if (splash != null) { splash.Size *= MathHelper.Clamp(Math.Abs(limb.LinearVelocity.Y) * 0.1f, 1.0f, 2.0f); } } GameMain.ParticleManager.CreateParticle("bubbles", new Vector2(limb.WorldPosition.X, limbHull.WorldSurface), limb.LinearVelocity * 0.001f, 0.0f, limbHull); //if the Character dropped into water, create a wave if (limb.LinearVelocity.Y < 0.0f) { if (splashSoundTimer <= 0.0f) { SoundPlayer.PlaySplashSound(limb.WorldPosition, Math.Abs(limb.LinearVelocity.Y) + Rand.Range(-5.0f, 0.0f)); splashSoundTimer = 0.5f; } //+ some extra bubbles to follow the character underwater GameMain.ParticleManager.CreateParticle("bubbles", new Vector2(limb.WorldPosition.X, limbHull.WorldSurface), limb.LinearVelocity * 10.0f, 0.0f, limbHull); } }