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.
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.
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.
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?