Charas-Project
Game Creation => Requests => Topic started by: Dominicy on April 25, 2008, 07:30:45 PM
-
No hurry considering I've got a working HUD for my current game, but in the planned sequel the player will level up, and it'll be too much work to make the life bar grow with every level. The problem is, I don't know how to change the length of the bar depending on what percent the character's at.
If that didn't make sense, I'll try to simplify it. The life bar will be 50 or 100 pixels long, and I don't know how to make the life bar lengthen or shorten based on how much life the character has left.
I already tried the search button. If this is the wrong section, I apologize, I haven't used the forum for anything RPGmaker related in awhile XD
-
Try a digit thing instead. Zum beispiel:
Assign the total amount of health to a variable, which changes for every level achieved or nut eaten, and the amount of health left another variable, which changes after every healing. Then, have this variable counter displayed on the screen somewhere.
I'm not sure on details since I do very little advanced programming, but hopefully this will put you on the right track. If you can't figure this kind of system out, try using a picture system based on value input or something. Hope it helps!
-
That could work. The next problem is that I don't know how to display a variable on screen x_x
-
if health left equals 10, display image 'health10' at x,y postition
that is how it should work, tell me if it doesnt...
-
I know how to do a conditional branch, my problem is that I don't know if there's an easier way to make the HUD than doing a list of as many as 250 conditional branches checking the character's health.
-
youre gonna need a million Branches, a few variables, and some show images attached to many of your branches
-
( (amount of health) / (maximum health) ) (100) = healthpercent
now take healthpercent, mod it by 1, subtract that amount from healthpercent, and you have %health rounded down to the nearest unit.
a.k.a. : healthpercent - (healthpercent % 1) = health
now, health will be a whole number between 0 and 100