Add fireball particles, add max lifespan to fireball

This commit is contained in:
2024-02-10 11:39:01 +01:00
parent 1c6fab51c6
commit 1487d67a3b
5 changed files with 57 additions and 38 deletions

View File

@@ -96,6 +96,26 @@ typedef struct ParticleEmitter {
} ParticleEmitter;
extern ECS_COMPONENT_DECLARE(ParticleEmitter);
static ParticleEmitter GET_FIREBALL_EMITTER() {
return (ParticleEmitter) {
.emitterLifetime = 2.0f,
.data.minOffset = { -2.0f, -2.0f },
.data.maxOffset = { 2.0f, 2.0f },
.data.emmitRate = 1.2f,
.data.emmitVariance = 1.0f,
.data.emmitVarianceMin = 0.0f,
.data.emmitVarianceMax = 1.0f,
.data.startColor = { 210, 0, 0, 210 },
.data.endColor = { 110, 10, 10, 110 },
.data.minLifetime = 1.0f,
.data.maxLifetime = 2.2f,
.data.minStartSize = 4.0f,
.data.maxStartSize = 6.0f,
.data.tileID = getParticleTypeTile(PARTICLE_CIRCLE),
.data.blend = BLEND_ADDITIVE
};
}
typedef struct Particle {
Vector2 pos;
f32 rotation;
@@ -278,11 +298,13 @@ extern ECS_COMPONENT_DECLARE(Unit);
typedef struct Tower {
f32 range;
f32 minDamage;
f32 maxDamage;
f32 projectileSpeed;
f32 projectileRadius;
i32 projectileDamageCount;
f32 projMinDamage;
f32 projMaxDamage;
f32 projMinLifespan;
f32 projMaxLifespan;
f32 projSpeed;
f32 projRadius;
i32 projDamageCount;
f32 fireCooldown;
f32 fireElapsed;
} Tower;