Help with retroactive score multiplier

This problem has bugged me so many time in the past in different ways: the multiplier works fine, the only problem is that it affects my damageTaken retroactively (as my enemy moves closer or farther). How can I constantly update the score, save it somewhere and keep adding whilst using the multiplier?

Why not store the health as a float? It will avoid damage being rounded down to 0.

Currently the only way to not affect all the hits taken is to convert the new damage to ints, which will be 0 most of the time.

Yep, it was the rounding that made the difference! Thank you :slight_smile:

I thought that the multiplier was retroactively changing the score, as my score seemed to be getting smaller at some stage, but now it works!

I actually solved it like this:

        damageTaken = damageTaken + 1 * damagePerDistance;