We gave you enough data so you can work on your side

If you can’t explore and get your own ideas…Learning will be useless

Also, this is not something about a clear example, you’re asking about maths, braden gave you an excellent resource about fading and exponential functions, you really should know about maths if you want to apply them

[lua]

This is not a lua lesson, it’s something more like a math lesson

As you know, a linear expression looks like:

y = x + a

Where y it’s the output, x our var (In our case velocity) and a it’s a constant, we need to fill 500px, so:

500 = (max_velocity) + 0 //Because we don’t need to fill pixels with extra data

But with this, we don’t will get the curve, because a curve it’s made by an exponencial function like

y = x² + a

y = x * x + a

500 = (max_vel) * (max_vel) + a

So you will need to clamp the values or divide it, because exponential values are really strongers and can change their values on violent ways

2² = 4

3² = 9

4² = 16

5² = 25

…

So:

max_width = (x * x)/a

Where “a” will be the value that lowers the final output

[/lua]

If you want more resource about exponential expressions, you can check the wiki, if you don’t know them, i recommend to you to learn them because will be really useful for your maths.