Deal with urchin's particle effects

main
En Yi 2024-10-05 19:18:42 +08:00
parent e52c9445c9
commit 1382cf1370
4 changed files with 3 additions and 4 deletions

View File

@ -11,6 +11,7 @@ typedef enum EntityTag {
LEVEL_END_TAG, LEVEL_END_TAG,
DESTRUCTABLE_ENT_TAG, DESTRUCTABLE_ENT_TAG,
DYNMEM_ENT_TAG, DYNMEM_ENT_TAG,
URCHIN_ENT_TAG,
} EntityTag_t; } EntityTag_t;
typedef enum SFXTag { typedef enum SFXTag {

View File

@ -258,7 +258,7 @@ static void destroy_entity(Scene_t* scene, TileGrid_t* tilemap, Entity_t* p_ent)
play_particle_emitter(&scene->part_sys, &emitter); play_particle_emitter(&scene->part_sys, &emitter);
play_sfx(scene->engine, ARROW_DESTROY_SFX); play_sfx(scene->engine, ARROW_DESTROY_SFX);
} }
else if (p_ent->m_tag == NO_ENT_TAG) else if (p_ent->m_tag == URCHIN_ENT_TAG)
{ {
ParticleEmitter_t emitter = { ParticleEmitter_t emitter = {
.spr = get_sprite(&scene->engine->assets, "p_spike"), .spr = get_sprite(&scene->engine->assets, "p_spike"),

View File

@ -250,7 +250,7 @@ Entity_t* create_urchin(EntityManager_t* ent_manager)
// The hit box is larger than the bbox // The hit box is larger than the bbox
// Unfortunately, it's too late to incorporate the offset for the bbox component // Unfortunately, it's too late to incorporate the offset for the bbox component
// So, offset the hitbox instead and external reposition it. // So, offset the hitbox instead and external reposition it.
Entity_t* p_urchin = add_entity(ent_manager, NO_ENT_TAG); Entity_t* p_urchin = add_entity(ent_manager, URCHIN_ENT_TAG);
if (p_urchin == NULL) return NULL; if (p_urchin == NULL) return NULL;
CBBox_t* p_bbox = add_component(p_urchin, CBBOX_COMP_T); CBBox_t* p_bbox = add_component(p_urchin, CBBOX_COMP_T);

View File

@ -161,8 +161,6 @@ Entity_t* create_player_finish(EntityManager_t* ent_manager)
p_cspr->current_idx = SPR_PLAYER_ENTER; p_cspr->current_idx = SPR_PLAYER_ENTER;
p_cspr->transition_func = &player_finish_transition_func; p_cspr->transition_func = &player_finish_transition_func;
add_component(p_ent, CTILECOORD_COMP_T);
CLifeTimer_t* p_clifetimer = add_component(p_ent, CLIFETIMER_T); CLifeTimer_t* p_clifetimer = add_component(p_ent, CLIFETIMER_T);
p_clifetimer->life_time = 0.9f; p_clifetimer->life_time = 0.9f;
return p_ent; return p_ent;