Hello everyone, this is version 2 of my gradient HP bar

New features from version 1:
Color change,
a gray bar that represents your max hp that hides behind your current HP
CONTROLES: use the arrow keys to add / minus HP
(screenshot)
Like the last version, no images are needed, so you dont have to worry about making tons of images for an hp bar

CONTROLES: Use the arrow keys to add / minus HP.
Here's the code for version 2:
- Code: Select all
for (i2=0; i2<maxhp; i2++)
{
setpen(69, 69, 69, 0, 3);
moveto(i2, 0);
lineto(i2, height-1);
i2++;
}
for (i=0; i<hp; i++)
{
for (gradl=0; hp>gradl; gradl++)
{
setpen(gradl, hp+gradl, 255, 0, 3);
moveto(i, 0);
lineto(i, height-1);
i++;
}
}
NOTE:
Your canvas can go all the way across the screen but it wont change the gray bar, You have to set the max hp and the normal hp in create actor. Look inside the GED file for more information

Old Version:
Hello, I made an H P bar that can be used for many games and it's not 1 solid color, it's a gradient and requires no images! It's all done by canvas.
- Code: Select all
for (i=0; i<hp; i++)
{
for (gradl=0; hp>gradl; gradl++)
{
setpen(gradl, hp, 255, 0, 3);
moveto(i, 0);
lineto(i, height-1);
i++;
}
}
Here's a few screenshots
Here's the GED file. Likewise, no data folder needed

CONTROLES:
Use the left and right keys to make the hp bar bigger / smaller