Hi. I have a simple question that where is good for hit effect object.
When I shoot a missile and the missile hit a enemy, a hit effect will be created. (btw “hit effect” is correct word? let me know!)
I'm a beginner in game programming. So I don't know what I am thinking is good or bad.
A missile has a collision handler. So if a missile has collision, the handler will be called. If a missile class has a hit effect object as a member, I simply can write a code like next.
// called when this object had collision.
Missile::collision_handler(…)
{
...
// create hit effect.
m_pHitEffectMng->Create(...);
}
// Or I have to receive the hit effect object as a handler's parameter.
What do you think guys? (I'm not using an engine.)