How do I make a life bar that goes down slowly, that is, I have 100 life and it goes down 10 times and uses images as life, that is, I have a line that is made by images and when a time passes, like, 30 second travel a percentage of your life
How do I make a life bar that goes down slowly, that is, I have 100 life and it goes down 10 times and uses images as life, that is, I have a line that is made by images and when a time passes, like, 30 second travel a percentage of your life
Use an int time counter field. Increment it every act step. Use the modulus operation to make it loop back to zero at a value of 1800 to approximate 30 seconds of time. Test its value after incrementing. When its value is zero, subtract from life. The bar can be treated as being from 0 to 10 since you want it to jump by 10s. If you display the value as text as well, just multiply by 10. Update bar image only when its value changes.