A
Adjud
Guest
Hi,
I have a boss object controlled by a controller, the boss has a bass thats plant like when the bosses hp hits a certain lvl the base changes its image_index accordingly...
my step event code for objbossbase:
Edit2: I simplified the above code with
this new code works better but is still not a perfect... the base has 4 images of color based on health, boss.mhp is the max hp of the boss which in this case is 10,000, bosshp is whats effected from damage. so essentially my code just divides the existing boss hp by the bosses max hp, im assuming since damage is so random the divided number won't be an even 1, 2, 3, 4.
is there a way to remove the digits after the decimal for my code? I want this to be relative with any boss hp.
the result is nothing, the base object stays at image_index 1. i simply want the sprite to change 1 index per quarter of boss hp, I'm sure there is a simpler way to this this than the code I guessed on above.
Thanks for any help
EDIT: Also what is the best way to make a sprite turn white on collision? I have the code to change its rgb or hsv, but if i set
it makes the sprite normal, I can use that to change the color to red, blue purple etc, but I want it to change brighter or white as an effect when being hit by a weapon or spell.
whats the best way to do that?
I have a boss object controlled by a controller, the boss has a bass thats plant like when the bosses hp hits a certain lvl the base changes its image_index accordingly...
my step event code for objbossbase:
Code:
if controller.bosshp > 8000 {
image_index=1;
}
if controller.bosshp > 5000 || controller.bosshp < 8000 {
image_index=2;
}
if controller.bosshp > 1500 || controller.bosshp < 5000 {
image_index=3;
}
if controller.bosshp > 0 || controller.bosshp < 1500 {
image_index=4;
}
Code:
image_index = controller.bossmhp/controller.bosshp;
is there a way to remove the digits after the decimal for my code? I want this to be relative with any boss hp.
the result is nothing, the base object stays at image_index 1. i simply want the sprite to change 1 index per quarter of boss hp, I'm sure there is a simpler way to this this than the code I guessed on above.
Thanks for any help
EDIT: Also what is the best way to make a sprite turn white on collision? I have the code to change its rgb or hsv, but if i set
Code:
image_blend=make_colour_rgb(255,255,255);
whats the best way to do that?
Last edited by a moderator: