Hello! I trying to find a formula to calculate and set the frame of the animation in a sprite, but i can't.
Basically, i have a sprite with 5 frames, 0 is empty, then there is 1, 2, 3 and 4.
They are cracks that get bigger in crescent order, then i have a Max_HP and Actual_HP for the object, hp that decreases when i hit the object(Block) with a weapon using another variable in the weapon that represents the strength, so i did this:
Set Block animation frame = MaxHP - ActualHP, if both is 5, then it works very well, but what if i wanted another object with more MaxHP/HP, i can't create a specific animation for every 1 unit of HP.
So my question is, how do i make the frames match with the remaining HP for every object, like 8 HP but having only 5 frames?
I can't find a solution.