-
[help] health bar code
what is a simple code for a health bar... im not animating it i just want health to be 100 or what eva i choose...
i think i will be right coding the enimies to take away health as i have seen lots of other people post some good stuff about it
thank u
-
Make a simple MovieClip Health Bar object.
then you can use:
at startup:
_root.starthealth = 127;
_root.health = _root.starthealth;
makedamage = function(damage){
_root.health -= damage;
_root.healthbar._xscale = (_root.health/_root.starthealth)*100;
}
-
thanx and aslo how do i make it say the number of health thats left???
-
:)
_root.healthleft=_root.starthealth-_root.health
-
Are "damage" and "start" actual functions in Flash or is that code supposed to be edited to suit the instance? Also, how would one make enemies take health off?
-
enemies take health off with hitTest