public Emitter(List<Texture2D> texture, Vector2 pos, Texture2D EmitterTexture, Effect color, Vector2 particelSize, Vector2 particelPower, List<Vector2> emitterAngel, Vector2 emitterRange, float particelAmount, float spawnTime, float startParticel, Vector2 lifeDrain, Vector2 lifeTime, Vector2 stayOnMax, Bewegungsprofile bewegung, Spawnprofile spawnprofile) { this.ParticelStayOnMax = stayOnMax; this.spawnprofile = spawnprofile; this.startParticel = startParticel; this.bewegung = new BewegungsHandler(); this.ParticelLifeTime = lifeTime; this.ParticelLifeDrain = lifeDrain; this.EmitterAngel = emitterAngel; this.EmitterRange = emitterRange; this.EmitterTexture = EmitterTexture; this.Position = pos; this.ParticelSize = particelSize; this.ParticelTexture = texture; this.particels = new List<Particel>(); this.PerticelPower = particelPower; this.ParticelSize = particelSize; this.r = new Random(); this.color = color; this.EmitterMaxParticel = particelAmount; this.EmitterUpdate = spawnTime; this.Origin = new Vector2(this.EmitterTexture.Width / 2, this.EmitterTexture.Height / 2); this.bewegungsprofil = bewegung; this.go = false; Start(); }
public Particel(Texture2D ParticelTexture, float particelSize, Vector2 particelVelocity,float agility,Vector2 power, float mass, float angularVelocity, Vector2 spawnPos, float lifeTime, float drainLife, float stayOnMax, Bewegungsprofile profil, Spawnprofile spwanprofile) { this.spawnprofile = spwanprofile; if (this.spawnprofile == Spawnprofile.FadeIn) { this.lifeTime = lifeTime / 2; currentLife = 0; up = true; down = false; } else if (this.spawnprofile == Spawnprofile.Instant) { this.lifeTime = lifeTime; this.currentLife = this.lifeTime; up = false; down = true; } this.agility = agility; this.stayOnMax = stayOnMax; this.mass = mass; this.profil = profil; this.drainLife = drainLife; this.randome = r.Next(100, 500); this.texture = ParticelTexture; this.scale = particelSize; this.velocity = particelVelocity; this.angularVelocity = angularVelocity; this.pos = spawnPos; this.origin = new Vector2(texture.Width / 2, texture.Height / 2); // this.currentVelocity = velocity; this.power = power; }