Could you explain what you are trying to achieve with this? It is kinda hard to understand what you are trying to do..
Alright, I'll repeat.. So game starts, and in a middle of the screen appears some total amount of value which player can earn for this match. What I want to achieve with this is to for those 5 seconds, the totalAmount will start increasing, from 0 to 2250, so the idea is something like incrementing the value from 0-100..
How do you know
should be 450 each time your loop updates? If you know it's going to be 450, why not just add 450 and then reset the value each time the program goes through the loop? I don't entirely understand your question.
Well, when you get to 5s, totalAmount at that point should be 2250, because every second totalAmount value is increased for 450:
1s - 450
2s - 900
3s - 1350
4s - 1800
5s - 2250
EDIT: I might be wrong, it should not maybe be at that point 1s - 450, as I aim to compute the amount of the value it should increase for, to reach that 2250.
So it can even be 453...
You lose precision with integer. 10/3 = 3, not 3.(3). Same here. currentValue should be a float. You should get getter for currentValue or something and cast it to an int from float. You can also use double, but floats are usually enough for simple tasks which don't require some kind of incredible precision. I hear that floats are faster than doubles.. Don't know about that though. Anyway, use floats or doubles instead of ints for such computation like the one you are trying to achieve.
You are right, I forgot that, I used int type for this variables... However, I'm still getting not precise number 2250, instead now I get the 2253, 2256, 2254, I assume it's because I'm dividing with delta.. ??