• 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!

SOLVED HELP, PLEASE! - Increase Max Health With Sprite

JustEnix

Member
I'm new to game programming, I don't have enough knowledge to do everything I want to do on my own, that's why I need your help, guys.

I created a sprite for the player's health, but then I ran into a problem: how am I going to show that player health is growing as he level up and increases his maximum health

What I want to do is that when the player increases his maximum health, the health sprite shows that his health did increased.

Here is the sprite I'm using for the health, mana and stamina:
spr_statusFrmwrk_0.png
 

JustEnix

Member
Import the sprite for the maximum amount of health (the longest) and then use draw_sprite_part to draw the needed length.
Thank you very much for your comment, can you explain please? I'm new to game programming like I said, so I don't know how I could do what you said
 

Yal

šŸ§ *penguin noises*
GMC Elder
Separate sprites for edges and center of the bar sounds like the easiest solution: draw the center stretched / repeated (depending on what looks the best in your art style) to fit the health, and then glue the edges onto the start and end of the centerpiece.
 

JustEnix

Member
Separate sprites for edges and center of the bar sounds like the easiest solution: draw the center stretched / repeated (depending on what looks the best in your art style) to fit the health, and then glue the edges onto the start and end of the centerpiece.
Thx, that helps a lot
 
Thank you very much for your comment, can you explain please? I'm new to game programming like I said, so I don't know how I could do what you said
Look up the function in the manual. It allows you to draw specific parts of a sprite. In your case you want "width" to be a variable.
 
A

Ageless_Lord

Guest
You could use the draw_healthbar function in addition to the above. You could draw it under (or over) your sprite to still allow for your own artistic flare to shine through, while also using a variable as the second x coordinate to grow or shrink the bar, while the length of your sprite could be used to dictate the maximum size of the bar.

Stylistic choices have a great number of options available for them.
 
Top