I need a way to get individual health for enemies

I’m making a Half-Life game and want the enemies to die in 3 hits.
maybe a variablek that tracks hits would work? idk.

image

1 Like

You could use the sprite data extension

Love the colour palette!!!

  1. Download sprite data extension
  2. Make the sprite number data and set the value to the enemy life (in this case 3) when enemy is created (use on sprite of kind enemy is created block).
  3. When enemy overlaps with damage source change sprite data number by -1
  4. When enemy is damaged check if sprite data number ≤ 0 (less than or equal to is important) and if it is destroy enemy. Else do step 3

can you give an example or is this how it works?

nvm it worked it’s just I accidently set it to player instead of enemy
:sweat_smile: not my brightest post lol

1 Like

Great!

you can also add the health bar extension its can make it much easyer

u can use statusbars.