Skip to content

A lighting demo inspired by my favourite game, Terraria

Notifications You must be signed in to change notification settings

Dot32Dev/Lighting-Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2D Lighting

side scrolling terraria-inspired lighting in Love2D lighting

How is it done?

  • 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

About

A lighting demo inspired by my favourite game, Terraria

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages