IGM Tutorial: Health Bar

in Tutorials

Want to check out a PDF of this tutorial? Right click save as HERE.

We’ve already went over how to show enemy and player health with numbers.
Let’s take that knowledge and use it to apply a health bar instead. We’ll be
using the shooting game we were working on. Here is the GPD if you need it.
Health bar resource!

So import your health bar under the “Materials” tab, and then head to the
“Memories” sub-tab. You already have your “Player Health” memory set at 3, but
in order for a health bar to work properly you need to set your Max Health as
well. So go ahead and change that memory to 3 for now. Then head to the
“Menus” tab and the “Menu Parts” sub-tab.

Here we’re going to create a “Horizontal Meter”, so hit the button and make it
happen! Rename it something akin to “Player Health Meter” for now. Set it up
to use our health bar graphic, and then head to the “Menu-Part Specific
Functions” sub-sub-tab. At the bottom here you’ll find a section called
“Memories To Be Linked (Defaults)”. For “Memory” select Player Health, and for
“Max Limit Memory” select Player Max Health.

Switch over to the “Menus” tab, and select our HUD menu. Under the “Menu
Parts” sub-sub-tab you can grab the health bar and place it on the screen.
Flip up the “Parts Placed On The Layout” details section with the little
arrow, and you can edit it’s placement more accurately. I went with 16×48 to
put it close to the number representing player lives and directly under the
“HEALTH” text. Here you should set the “Memories To Be Linked” again for
Player Health and Max Health.

After setting that up you’ll want to remove the number we were using before so
switch to the “Items” tab here and you can either delete it or select the
“Hide” option. That’s it for now! Give it a test and watch your health
deplete. If you’d like to see this in action before trying it yourself you can check out this GPD. Also don’t forget that this could be applied to any number of things.
You could set up memories for Mana or MP and Max Mana/MP and have a magic bar
or any number of other things. Happy creating!

Ready to start your own game in IGM? Purchase IGM at a 10% discount using the coupon code igmakerohyeah. Any questions, comments? Ask them in the comment section below.

Comments on this entry are closed.

  • Jason

    Great tutorials, I’ve followed the whole series so far! Can’t wait for the next one.