Playmaker Forum

PlayMaker News => General Discussion => Topic started by: gamedivision on December 19, 2012, 05:13:38 PM

Title: health for enemy
Post by: gamedivision on December 19, 2012, 05:13:38 PM
ive never seen any questions on this,how would i make health for an enemy character,so if i hit him with a sword it will take away a percentage of health when the health reaches zero he dies.


thank you
Title: Re: health for enemy
Post by: DARK_ETERNAL on December 20, 2012, 02:30:20 PM
A percentage... You might write a math function that takes the current health of your enemy, and an attack factor, which is that of the weapon hitting the enemy. Your enemy would get this attack factor, and have sent that value to an FSM, in the enemy, that calculates the actual damage value and substracts it from the enemy's health. You can, as well, have the weapon deal a specific damage value, so your enemy's hmm... let's say, HealthManager FSM will get that value and substract from the enemy's HP. Does this have any sense for you?