Thread replies: 9
Thread images: 2
Anonymous
Boring code/math help
2016-07-15 06:02:39 Post No. 156241
[Report]
Image search:
[Google]
Boring code/math help
Anonymous
2016-07-15 06:02:39
Post No. 156241
[Report]
Okay, I know this isn't sci so I don't know how many math experts hang around these parts, but I need some help. Bare with me, I have diagnosis-able brain problems when it comes to math stuff, so I'm a bit stumped here.
I have this shitty game thing I'm working on and I need to figure out how to process an effect that scales with the stat it effects over time.
So lets say x is health or something, like 100 hp and the effect adds 25% of x to x each minute. I want to pass 3 minutes or something
This works fine if I interval the equation each minute that passes, like below
given that x = 100
1: x += (x *0.25) = 125
2: 125 += (125*0.25) = 156.25
3: 156.25 += 156.25*0.25 = 195.312
So there's that, but I don't want to interval through each minute of time that's passed. say its 1440 minutes or something, I don't want it to cycle each time, I want a single equation but how do I write it so it just scales for a time variable
obviously if t = 3 and x = 100
x += (x*0.25)* (t) = 175
and that's not the same outcome as doing the equation 3 times, so my math-dead brain is stuck