/// <summary> /// Constructor /// </summary> /// <param name="achv">Associated achievement</param> /// <param name="duration">Duration to stay visible (ms)</param> /// <param name="position">Starting position</param> /// <param name="width"></param> /// <param name="height"></param> public AchievementToast(Achievement achv, int duration, Vector2 position, int width, int height) { title = achv.Name; description = achv.Description; age = 0; lifespan = duration; this.position = position; this.width = width; this.height = height; banner = SpriteDatabase.GetAnimation("achievement_banner").Texture; // Yellow particles spew out on the left and right in semi-circles away from the banner leftSpewer = new ParticleSpewer( position.X+53, position.Y + 52, 10000, 30, MathHelper.ToRadians(90), MathHelper.ToRadians(270), 0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f); leftSpewer.Absolute = true; leftSpewer.Start(); rightSpewer = new ParticleSpewer( position.X + width, position.Y + 52, 10000, 30, MathHelper.ToRadians(-90), MathHelper.ToRadians(90), 0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f); rightSpewer.Absolute = true; rightSpewer.Start(); }
public Streaker(PhysicsComponent2D phys, DrawComponent draw) { physics = phys; this.draw = draw; //Initialize Components using Entitybuilder! this.BoundingRectangle = new COMP476Proj.BoundingRectangle(phys.Position, 16, 6); inputTimer = 0; recoverTimer = 0; inputDelay = 100; superFlashTimer = 0; superFlashDelay = 20000; superFlashParticles = new ParticleSpewer( phys.Position.X + draw.animation.FrameWidth / 2, phys.Position.Y + draw.animation.FrameHeight / 2, 10000, 100, 0, MathHelper.TwoPi, 500, 1000, 2, 600, 30, 60, 0.1f, 0.1f, 1, 1, true, 0.75f); danceParticles = new ParticleSpewer( phys.Position.X + draw.animation.FrameWidth / 2, phys.Position.Y + draw.animation.FrameHeight / 2, 10000, 100, 0, MathHelper.TwoPi, 50, 300, 2, 350, 180, 200, 0.25f, 0.5f, 1, 1, true, 0f); powerParticles = new ParticleSpewer( phys.Position.X + draw.animation.FrameWidth / 2, phys.Position.Y + draw.animation.FrameHeight / 2, 10000, 10, 0, MathHelper.TwoPi, 50, 300, 3, 350, 180, 200, 0.5f, 1f, 0.5f, 1, true, 0f); powerParticles.Start(); }