D
Drysteven
Guest
I have created an inventory that uses a sprite to show the number of that item in the inventory. Then as I increase the number of that item in the inventory I increase the image_index of the sprite. For some reason when I increase this number by 1 it counts like the following:
1 2 3 4 5 6 7.00 8 9 10 11 12 13 14.00 15 16 ...
When it reaches 7.00 it acts the same as if it was at 6, then when adding one more it changes to 8 and acts as expected. The same thing happens at 14.00 and at many other values throughout which seem to be random (the next one is 25 then 28 then 31), but it is always these values when I run it. I have made it so my code only changes the image_index at one spot and then I put it in a step event to set it and print out the values.
This will print out "7.00 7" and I am not sure why since that is the only are that the image_index of this object is changed. image_speed is set to zero in the sprite. If I instead set image_index to num+0.1 then everything works correctly, but I am not sure why I would need to do this. I have spent the last couple of hours on this and am starting to think that it might be corrupt, but I am not sure so I wanted to see if anyone else had any ideas. Thanks!
1 2 3 4 5 6 7.00 8 9 10 11 12 13 14.00 15 16 ...
When it reaches 7.00 it acts the same as if it was at 6, then when adding one more it changes to 8 and acts as expected. The same thing happens at 14.00 and at many other values throughout which seem to be random (the next one is 25 then 28 then 31), but it is always these values when I run it. I have made it so my code only changes the image_index at one spot and then I put it in a step event to set it and print out the values.
Code:
image_index = num;
show_debug_message(string(image_index) + " " + string(num));