How can I improve this health bar system?
It turns out that even where I work to reduce the green bar represents good health and appearance of the red bar representing loss of health, but Quanda health reaches zero is an error that shows another green bar that I do not know where it came from, how can I fix this, or improve this code?
The link is this:
https://drive.google.com/file/d/0B-bh_e ... sp=sharing
the code is bellow.
Ok after watching the game for a little while here is what I see.
on spawn resets green life on all enemies, but not life thus making green bar reappear on death.
There needs to be some kind of for each statement to determine what is happening to each.
also I disabled everytick as it was not needed. per what I was reading in the code.
So with that code can I improve it?
The problem is that there's no system in place to pair the enemies with the health bars. Whenever an enemy dies, the health bar is not destroyed and it's moved to another enemy (which can be seen in debug mode)
This can be easily fixed by using containers
I also did a little cleanup on the events. You can put the "find path" right after spawning the enemy, and the health bar positioning now happens every frame
Develop games in your browser. Powerful, performant & highly capable.
Thank you my friend, [quote:2tramhbw]7Soul
this worked perfectly, I still had no notion of using containers, it worked perfectly, was of great help.