• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to do HP

sans17

Member
Hi, i want to know how i can do the HP (healt point) like in a RPG. I did some research but the only thing I saw is tutorial with HEALT BAR, but i don't want to show a healt bar, i just want to show the numbers, like in this image:
1PI0XcG.jpg

Does someboddy can help me, please?
Also, I work with GML.
 

FoxyOfJungle

Kazan Games
So you will just use variables, then draw them, the string() function will be useful in the process:

GML:
draw_text(10, 10, string("HP: ")+string(hp_current)+string("/")+string(hp_max));
You don't necessarily need to use string() if the argument is a string, but I did it to stay more organized.


Now you just have to draw the text in the right place.
 
Last edited:
Top