#Should I decrease the player's health as a result of enemies or directly?

1 messages · Page 1 of 1 (latest)

ripe pawn
#

Hi, I think basic question but I was wondering how you would managed this case, I have a simple 2D shooter with a player and let's say a hundred enemies around. I want the player to be able to take damage from enemies, you would do a system where the player have a sphere cast around him with enemy tag and get the damage amount from the hit and apply it to the player's health, or every enemies having a sphere cast around them and check if a player is in it to apply damage. I think the first is much better but I want your advices. Thanks

mellow aspen
#

In my previous project, I modeled each hit as an entity which was spawned at the frame of enemy's successful attacks. Hit entities move towards the player and upon collision will cause damage. I use this approach for players and skills too.

#

I generalized this approach for every types of attack, either melee or ranged.

ripe pawn
#

In my case the proximity of an ennemy is considered as an attack, you would ''shoot' ' towards the players at closer distance, if I'm right ?