Yes I am confused, I can't seem to get down the rgb crap in GML and I don't get it. If you could help me out. I'd post it in the forums but seeing as they're down I have to blog about my troubles.
What I'm aiming for is that when the object gets hit it flashes white the returns to normal.Heres what I use to set the variables in a create event.//scrAllInit(sprite_color,normal_health)
color = argument0
local_health = argument1
color_red_def = color_get_red(color)
color_green_def = color_get_green(color)
color_blue_def = color_get_blue(color)
color_red = color_get_red(color)
color_green = color_get_green(color)
color_blue = color_get_blue(color)
hit = 0
if hit = 1
{
if color_blue < 254
{
color_red -= 1
color_green -= 1
color_blue -= 1
}
else
{
color_red += 1
color_green += 1
color_blue += 1
}
if color_blue = color_blue_def
{
hit = 0
color_red = color_red_def
color_green = color_green_def
color_blue = color_blue_def
}
color = make_color_rgb(color_red,color_green,color_blue)
}
Should work. The only thing I saw was the fact that there could be negative numbers…
Wait, change the < 254 to > 254. Read that part out loud and see why.Check out this minigame I made. I think it does what you're trying to do (and unregistered, as well).
you cam make a duplicate sprite by greyscaling sprite with gm, and draw that instead of the normal sprite in a additive blend mode.
draw event: