JimPancakes
Member
Please take a look at this code:
I also made a "draw_text" of the "count_char" variable and "floor(count_char)".
The problem is that the "if floor(count_char) = count_char" function doesn't work consistently. For example when "count_char" is 1, "floor(count_char)" is 0.
But when "count_char" is 2, 3 or 4, then "floor(count_char)" works and is the same as "count_char".
But then, when "count_char" is 5, "floor(count_char)" fumbles again and stays 4.
Please help!
Code:
if keyboard_check_pressed(vk_space)
{
count_char += 0.1;
if floor(count_char) = count_char
{
image_alpha += 0.03;
}
}
The problem is that the "if floor(count_char) = count_char" function doesn't work consistently. For example when "count_char" is 1, "floor(count_char)" is 0.
But when "count_char" is 2, 3 or 4, then "floor(count_char)" works and is the same as "count_char".
But then, when "count_char" is 5, "floor(count_char)" fumbles again and stays 4.
Please help!