Lighting based off distance

Probably been asked a lot, but trying to do darkness based off how far away it is from a certain object. Currently using alpha on an all black sprite and lowering the alpha depending on how close it is to the object, which I’m not doing correctly.

Just put a proximity and then the closer it is the lower the alpha is. You can do closeness using expressions and calculating the difference and stuff.

Good idea! Proximity does cause lag, though. It might be better to calculate the distance through expressions.
(This is not done yet, but here is a game showcasing some expressions I have made. Expressions! - Flowlab Game Creator)

Distance Formula;
Math.sqrt(Math.pow(C-A),2)+Math.pow(D-B,2))

Is this what your looking for?

This does work, but I don’t know how to change the numbers to make it go farther out as the distance is different for what I’m trying to do. In other words, how do I reduce the light falloff?
Also, I’m using an Ease block to make them smoothly lighten but I want the ones farther out to take longer to reach their light level which I don’t know how to do without just testing stuff for the time variable in the Ease block.

I got the distance (Just tested dividing the expression until I got what I wanted)