From aab8e424ec158b7e8cf5fa8fb945d3e15119ac7b Mon Sep 17 00:00:00 2001 From: John Pavek Date: Tue, 7 Nov 2023 13:37:01 -0600 Subject: [PATCH] Last particle fix .... for now --- Entities/Archetypes/EffectsBuilder.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Entities/Archetypes/EffectsBuilder.cs b/Entities/Archetypes/EffectsBuilder.cs index 5282851..32379f7 100644 --- a/Entities/Archetypes/EffectsBuilder.cs +++ b/Entities/Archetypes/EffectsBuilder.cs @@ -12,7 +12,7 @@ internal static class EffectsBuilder { internal static void CreateExplosion(World world, Vector2 pos) { - var explosionEntity = world.Create(); + var explosionEntity = world.Create(); var explosionSprite = new Sprite(TextureKey.Explosion, "Assets/Art/explosion", 1f, true); explosionSprite.Position = pos; @@ -22,24 +22,22 @@ internal static void CreateExplosion(World world, Vector2 pos) var explosion = new Effect(); explosion.Duration = 0.3f; explosionEntity.Set(explosion); - } internal static void CreateFire(World world, Vector2 pos) { var effectEntity = world.Create(); - var effectSprite = new Sprite(TextureKey.Fire, "Assets/Art/fire1", 1f, true); var fireSize = Random.Shared.Next(1, 3); effectSprite.Play($"Fire{fireSize}"); effectSprite.Position = pos; - //effectSprite.Rotation = Random.Shared.Next(0, 360); + effectEntity.Set(effectSprite); var effect = new Effect(); - effect.CreateTrail = true; - + // todo stretch goal - make smoke + // effect.CreateTrail = false; effect.Duration = 1.5f; effectEntity.Set(effect); } @@ -72,7 +70,7 @@ internal static void CreateCannonTrail(World world, Vector2 pos) var effect = new Effect(); effect.Fadeout = true; - effect.FadeStart = 1f; + effect.FadeStart = 0.5f; effect.Duration = 1f; effectEntity.Set(effect); @@ -105,6 +103,8 @@ internal static void CreateAirTrail(World world, Vector2 pos, Vector2 motion, bo effectEntity.Set(new LayerAir()); } + #region Large Effects + internal static void CreateWindEffect(World world) { var singletonEntity = world.QueryFirst(); @@ -122,7 +122,8 @@ internal static void CreateWindEffect(World world) }, NovemberPiratesEngine.Instance.Camera); CreateAirTrail(world, centerPos, wind.WindDirection * 100, true); } - } + + #endregion } }