Accidental int division!

This commit is contained in:
IbanPlay committed 2022-01-06 19:06:24 +01:00
1 parent 603cefa603
commit 7cab3cea20
4 files changed
+4 -2

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ namespace CalamityMod.Particles
{
public class GenericSparkle : Particle
{
public override string Texture => "CalamityMod/Particles/Sparkle";
public GenericSparkle(Vector2 position, Vector2 velocity, Color color, float scale, int lifeTime, float rotationSpeed = 1f)
{
Position = position;
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Particles
/// </summary>
public int Lifetime = 0;
public float LifetimeCompletion => Lifetime != 0 ? Time / Lifetime : 0;
public float LifetimeCompletion => Lifetime != 0 ? Time / (float)Lifetime : 0;
/// <summary>
/// The offset of the particle in relation to the origin of the set it belongs to. This is only used in the context of a Particle Set
Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Particles
Color = Color.Lerp(Color, new Color(154, 139, 138), (float)Math.Pow(Utils.InverseLerp(0f, 0.57f, LifetimeCompletion, true), 2D) * 0.5f + 0.5f);
Color.A = 92;
float opacity = Utils.InverseLerp(1f, 0.85f, Time / Lifetime, true);
float opacity = Utils.InverseLerp(1f, 0.85f, LifetimeCompletion, true);
Color *= opacity;
}