Game Maker – Enemy Health Bars

20



Game Maker has a built in health bar system but this pointless if we need multiple health bars, for example for our enemies. In this guide, I go through some steps on how to add enemy health that is tied to each instance of that enemy.

Rating: Beginner

Note:
This video is an old video from an old channel that is merging with this one. I am in the process of bringing all those videos over to this channel.

20 Comments
  1. DRAG0NEX says

    Amazing it works perfectly!

  2. camo says

    my enemies dont move anymore after following tutorial

  3. M00M00 M00 says

    No don't waste ur time it dost work not saying it's this guy's fault I just probaly have a different version

  4. James Allan says

    Saved my game project thanks mate.

  5. Johannes Flyckt says

    Great tutorial!

  6. Ben Goodwin says

    how do you put the health bar in the top right corner of the screen, instead of above the enemy, like for a boss

  7. Crawyz says

    Thanks a lot, all the other tutorials I saw required scripts and code which I just didnt understand, this is simple fast and works. Thanks!

  8. YowLife says

    doesn't that mean if you have two enemies at the same time, just shooting one would reduce BOTH of their health bars?

  9. Matt Mcabben says

    FATAL ERROR inaction number 1of Mouse Event for Glob Left Releasedfor object johnny:COMPILATION ERROR in argument : 4 Error in expression:point_direction(x,y,mouse_x,mouse,y) position 36: Wrong number of arguments to function or script.PLEASE HELP

  10. Ultimate Game New's Network says

    my enemy is invisble

  11. Disease says

    Ideally GameMaker would easily support having multiple health bars going on at once using its health bar system, but since it doesn't, this video has the best information for working around that I've seen. 

  12. Core Studio says

    Hey is there a way in code of displaying text for only a short period of time?For example; i want to hit enemies and i want the amount of health they lost to be showed briefly above there heads for about 1 seconds and then deleting itself or just becoming non visible? PLEASE HELP

  13. ArticxNinjaz says

    alright so when my gamem loads up my enemy is stuck to the wall but the helth bar is were the enemy should be how do i get the image back to its origonal placealso if i shot the blank space under helth bar the enemy loses helth but i need the image there i dont want to be shooting at enemys that are invisble

  14. UltraDeathHug says

    so why did you say if hp percent is smaller than 1 it destroys self? why not hp current?

  15. UltraDeathHug says

    thanks this was really helpful indeed and i agree with you there on your response to marcus also want to say i appreciate that this video is made rather recently! my question is how could one change this system up to involve different level powered bombs.create different bomb objects and in the enemy object create collision events for each type of bomb and in each of those take away different values from hp current.i know i just answered my own question but i just work that way and extra info for others if thats even understandable. THANKS BRO!

  16. ReaperHST says

    Thanks man, you helped me fix my school project. my enemy wouldn't show because i did a different method of the hp. Thanks to you, i can now finish my final. 😀

  17. TheMisterm500 | Mr Vini says

    Thank you Man I am Brazilian Guy!!!

  18. tpem7777 says

    Hi when my hp = 0 their is some health bar left how can I fix this.
    Oh and my
    X1 = 9
    Y1 =16
    X2 = 22+(hp_percent/2)
    Y2 = 24

    Thank you

  19. Marcus Korvenius says

    I think xport is overall just much more usefull as xview, even for starters.
    If someone wants to learn, he will watch it more often until he gets the point, just my opinion as starter.

  20. Marcus Korvenius says

    you should do it with view_xview or view_xport and so on, its much more usefull for larger maps.

Leave A Reply

Your email address will not be published.