top of page

MFP: Damage and Death

The core of an action RPG is damaging enemies until they die while trying to stop them doing that to you. Damage systems come in many varieties but I have decided to keep mine simple and reserve the complexity for the abilities. Characters have an armour value which will later be determined by their gear. When damage is dealt to them, the armour value is subtracted before the damage is applied to their health. To test and demonstrate the system I created a fire gameobject.


The fire script detects players within it deals constant minor damage to them:

This calls the take damage function in the player controller script which is inherited from the baseCharacter script. If the character then drops to 0 health, they are destroyed.

To convey this info to the player, we have a basic slider UI object with its value being equal to the player's health percentage. Here is this whole system working:


Comments


bottom of page