how to make a health bar individual for each enemy?
3gfisch
Member Posts: 12
Hi
I would like to make a game like towerdefense, the enemys spawn each second from right and move to left and they have a selfe.health that becomes less if i shoot and if=0 they destroy but how to make a health bar that moves with the enemy and shows the individual health of each?
thx
3gFisch
I would like to make a game like towerdefense, the enemys spawn each second from right and move to left and they have a selfe.health that becomes less if i shoot and if=0 they destroy but how to make a health bar that moves with the enemy and shows the individual health of each?
thx
3gFisch
Comments
with different stat of the health bar then create set of rules that say:
if 100= health >90 change to image1 (with full health)
if 90 > health > 80 change to image2 (with a bit less health)
if 80 > health > 70 change to image3 (with a bit less health)...
etc...
this is one way to do that without manage X,Y position for each enemy actor...
it's a lot of graphics works and not very Accurate way to display health
but should be enough...
hope this is help...
You're going to struggle with this in GS unfortunately
can i make a group or some thing which has "global" attributes only in the group and then spawn this group for each enemy, in the group is the enemy and the health bar...
or can the spawn create an attribute for life,X and Y and if the enemy is destroyed delete this Attributes?
thx
with out health bar is no good solution
so enemy.health <100 should work for each enemy...
the graphics should contain an enemy image+ status health bar in all stats from empty to full.
so when you replace the image you replace the enemy and the status bat at onces...
or one attribute for all enemys? but i think that are global variables and so all enemys have the same life or no?
thx
so when you spawn an enemy actor he got his own health attribute.
when you create the rules then check on the "local" actor health.
this way you don't need global health or global XY attributes...
that's why i think it's the best solution...but i didn't test it my self.
the enemy has the health bar in his pic and loads an other pic if his live is less
yes not very nice but should work
thx
i think there is a method to add image on image without replacing the base actor image...
could be better solution...
set the attributes as real atribues and dont use change attirbut use Constrain Attribut and it work's well but only if things collide and this will make less HP
if you make, if you click on the enemy to less HP it doesn't work??? crazy
but for me works grate
pic's of settings
the new global but aren't global variables
http://img684.imageshack.us/f/hpbar3.png/
constrain not change
http://img444.imageshack.us/f/hpbar1.png/
http://img145.imageshack.us/f/hpbar2.png/
ant so it looks
http://img196.imageshack.us/i/bildschirmfoto20100627u.png/
only if collide, if mouse down doesn't work
http://img715.imageshack.us/f/hpbar4.png/
ok thx to all
3gFisch
http://www.mediafire.com/?ynmznzjgomz
Rule
When overlaps with bullet change self.Health to self.Health-1
Change self.colorAlpha to Self.colorAlpha-0.1
Rule
When self.Health = 0
Destroy actor
This way you get a visual idea of how close the enemy is to being destroyed, but you don't need constrains or a ton of images. The other thing you could change would be the actual color values instead of the alpha. Maybe make it get more and more red before destroying it. There would be a slight learning curve for the player, but after awhile you would figure out which shades of red meant near death.
i think it shouldn't work but it does ^^
if i have a grate game i'll buy the full version
can gamesald make the ios4 Apps?? multitasking...
It focuses on setting up the weapon's "sensors". He uses "particles" to display the weapon's graphic, while the actual actor is an invisible arm that swings around in a circle.
I'm thinking you could use that same logic to display the HP above the baddies.
Rule
When self.Health >=75
EB's particle logic with "Full" HP image
Image = `<||||||||>`
Rule
When self.Health >=50 AND <75
EB's particle logic with "3/4" HP image
Image = `<||||||-->`
Rule
When self.Health >=25 AND <50
EB's particle logic with "1/2" HP image
Image = `<||||---->`
Rule
When self.Health >=12 AND <25
EB's particle logic with "1/4" HP image
Image = `<||------>`
Rule
When self.Health >=1 AND <12
EB's particle logic with "1/8" HP image
Image = `<|------->`
thx all