sorry , i mean personalized health bar for each enemies.i can't it...
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
Well, the process is the same but you have to constrain the health bar to a position above the enemy. If you have more than a few enemies, have the enemy spawn its own health bar and then use a table to "broadcast" the enemy's position and have the health bar "read" the position from the table. To coordinate the two actors, have a rule in the enemy that increases the value of game.enemyNumber by one and writes to that row of the table and have a rule in the health bar actor that sets its table row to the same value. I know, kind of confusing... maybe I can make a demo.
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
Okay, here's the demo. It starts with three enemies on screen (each with its own health bar) and spawns a new enemy every three seconds. Tap an enemy to reduce its health by one. When an enemy's health reaches zero, it is destroyed.
Comments