Add fireball particles, add max lifespan to fireball
This commit is contained in:
@@ -58,11 +58,13 @@ void updateParticleEmitter(ecs_iter_t *it) {
|
||||
ecs_entity_t entity = it->entities[i];
|
||||
if (ecs_has(ECS, entity, EmitterAttachment)) {
|
||||
EmitterAttachment attachment = *ecs_get(ECS, entity, EmitterAttachment);
|
||||
if (ecs_is_alive(ECS, attachment.baseEntity)) {
|
||||
Vector2 pos = *ecs_get(ECS, entity, Position);
|
||||
pos = Vector2Add(pos, attachment.offset);
|
||||
emitter[i].pos = pos;
|
||||
if (!ecs_is_alive(ECS, attachment.baseEntity)) {
|
||||
ecs_delete(ECS, attachment.baseEntity);
|
||||
continue;
|
||||
}
|
||||
Vector2 pos = *ecs_get(ECS, attachment.baseEntity, Position);
|
||||
pos = Vector2Add(pos, attachment.offset);
|
||||
emitter[i].pos = pos;
|
||||
}
|
||||
|
||||
const struct ParticleEmitterData data = emitter[i].data;
|
||||
|
||||
Reference in New Issue
Block a user