Hello to all, i would like to know, for my ennemies in all the level, how i can add an energy bar?? When the player hit an annemy he have to hit him somes times before the ennemy die. I would like to have this kind of stuff for all the ennemies.
Well the basic health bar concept is to adjust an object's width based on a variable. Perhaps when an enemy is hit, you could create an energy bar at that enemy's position. Maybe it could have fade behavior with fade in and fade out?
This may or may not work, (I don't know too much about this)
Step 1. Add a sprite that looks like a health bar. Step 2. Set up a variable named "Enemy Health" (or something) and set the number to whatever you want say 5 (so 5 hits and the enemy dies) Step 3. Assign the variable to your enemy sprite. Step 4. Go to your event sheet and select "System", select "Subtract from variable" (or whatever says subtract). Select the variable as "Enemy Health" and the number as 1. Step 5. Select the health bar sprite and add a fade behavior.
Not sure how to do it but somehow you can assign it so it fades 1 every hit till it goes away completely after 5.