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; }
public Vector2 move(Bewegungsprofile profil,Vector2 velocity, float agility, Vector2 power) { switch (profil) { case Bewegungsprofile.Linear: return linear(); case Bewegungsprofile.Random: return random(velocity, agility, power); case Bewegungsprofile.LinearRandom: return linearRandom(velocity,agility, power); } return Vector2.Zero; }
public Vector2 move(Bewegungsprofile profil, float power,Vector2 velocity) { switch (profil) { case Bewegungsprofile.Linear: return linear(power,velocity); case Bewegungsprofile.Random: return random(power,velocity); case Bewegungsprofile.LinearRandom: return linearRandom(power, velocity); } return Vector2.Zero; }
public Emitter(Vector2 pos,DebugFlag flag) { this.debugFlag = flag; this.stringBuilder = new StringBuilder(); this.particelPerUpdate = Vector2.Zero; this.ParticelStayOnMax = Vector2.Zero; this.bewegung = new BewegungsHandler(); this.ParticelLifeTime = Vector2.Zero; this.ParticelLifeDrain = Vector2.Zero; this.EmitterAngel = new List<Vector2>() { Vector2.Zero }; this.EmitterRange = Vector2.Zero; this.EmitterTexture = null; this.Position = pos; this.ParticelSize = Vector2.Zero; this.ParticelTexture = new List<Texture2D>(); this.particels = new List<Particel>(); this.PerticelPower = Vector2.Zero; this.ParticelSize = Vector2.Zero; this.r = new Random(); this.color = null; this.EmitterMaxParticel = 0f; this.EmitterUpdate = 0f; // this.Origin = new Vector2(this.EmitterTexture.Width / 2, this.EmitterTexture.Height / 2); this.bewegungsprofil = Bewegungsprofile.Linear; this.go = false; }