For example:
I have an ENEMY entity and BULLET entity. The bullet hit the enemy. Both of them have collision.
The enemy's health will be reduced when hit.
1st approach:
The enemy have a function that accepts the bullet that enters its collision area, it takes the bullet damage value. Then it will compute for the damage and apply it to the enemy.
2nd approach:
The bullet have a function that accepts the enemy it collides to. Then it will compute for the damage to be applied to the enemy.
3rd approach:
There is a central manager/script that handles have list of enemies and bullets that collided. It will take the hit bullet's damage and apply it to the affected enemy.
What is the better approach? Or other suggestions that is much better than these?