Skip to content

Commit

Permalink
Last particle fix .... for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Nhawdge committed Nov 7, 2023
1 parent 9568f88 commit aab8e42
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Entities/Archetypes/EffectsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class EffectsBuilder
{
internal static void CreateExplosion(World world, Vector2 pos)
{
var explosionEntity = world.Create<Sprite, Effect>();
var explosionEntity = world.Create<Sprite, Effect, LayerAir>();

var explosionSprite = new Sprite(TextureKey.Explosion, "Assets/Art/explosion", 1f, true);
explosionSprite.Position = pos;
Expand All @@ -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<Sprite, Effect, LayerAir>();

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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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<Singleton>();
Expand All @@ -122,7 +122,8 @@ internal static void CreateWindEffect(World world)
}, NovemberPiratesEngine.Instance.Camera);
CreateAirTrail(world, centerPos, wind.WindDirection * 100, true);
}

}

#endregion
}
}

0 comments on commit aab8e42

Please sign in to comment.