# How do I invert this calculation?

Get help using Construct 2

### » Wed Jan 14, 2015 6:05 am

I have an explosion which as closer as the object B are, more points will be earned.

I've established that every 5px closer, 1 point will be added and 200px is the explosions edge. So, in order to do an automatic comparison between these two objects, I came up with this:

Within 200px radius, I have 40 points (200/5 = 40 points)

I want to invert this, so I can get the right point measure. So, if I'm 5px close to the explosion, I get 40 points. If i'm 200px far, I get 1 point. If I'm 100px far, I get 20 points and so on

I'm not good with math so would be nice if someone could help me on that.
B
59
S
21
G
3
Posts: 604
Reputation: 6,691

### » Wed Jan 14, 2015 6:59 am

max points = 40

for example 200 - 50 = 150 , 150/200 = 0.75 , 0.75 * 40 = 30 points
B
75
S
27
G
10
Posts: 192
Reputation: 8,541

### » Wed Jan 14, 2015 6:43 pm

neverk wrote:max points = 40

for example 200 - 50 = 150 , 150/200 = 0.75 , 0.75 * 40 = 30 points

Thank you. You've saved me.
B
59
S
21
G
3
Posts: 604
Reputation: 6,691

### » Thu Jan 15, 2015 8:38 pm

kossglobal wrote:
neverk wrote:max points = 40

for example 200 - 50 = 150 , 150/200 = 0.75 , 0.75 * 40 = 30 points

Thank you. You've saved me.

You are very welcome. I'm glad that I could help.
B
75
S
27
G
10
Posts: 192
Reputation: 8,541