Press space for options resolution - amount of pixels rendered (Press the APPLY RES button to apply the changes) centerCircle - lower value= bigger pure white circle lightReach - how far the light goes after the big circle
A shadowcasting method I haven't seen before, probably because it's most likely pretty slow (in this project, most of the lag comes from drawing the grid). For each pixel it calculates the vector to the edge of each circle for both edges, then it finds the vector to the light source. If that vector is in between the first 2 vectors, then it is in shadow. FYI: the shadowcasting only works with circles since I don't know how to find the vector to the edge of any other shape honestly, making the light itself was the easiest simulation i've done. But when I added shadowcasting... that was not very easy lol don't ask me about the code because some of it I don't even understand myself it just worked so i'm not gonna touch it credits: me and random math stack exchange posts on google