side scrolling terraria-inspired lighting in Love2D
- Every block exposed to air is given a light value of 1, the rest have a default of 0
- Every block checks for it's neighbours light values, if any of them have a light value larger than our taget block minus the falloff value, then our taget block's light value becomes it's neighbours minus the falloff.
- Each block never gets any darker
- Lighting is run multiple times to propagate
- When a block is edited, the lighting is reset (restart from step 1 again)
My falloff is set to 0.2