I made a cool light thing

I made a cool light code that allows you to make sprite emit light and everything in the shadow will be darker or not even visible. Im not that experienced, so its not very optimised and runs on about 20fps on my phone. If you wanted to use this with other pallets, change the “shade” function. Each array of numbers represends a color(0-15) and the numbers in the array are numbers of colors that it will show if the color is in the darkness.

If im doing something wrong then im sorry, this is my first time using those forums. Also, english isnt my first language.

6 Likes

Welcome @Soleb244! I’m pretty sure that either woofwoof or Richard already made that, don’t remember who, I would recommend looking at it. You did do a pretty good job though! (I have absolutely no idea how to make the effect look good)

1 Like

The uneven edges and the light being offcentered are deliberate and not bugs in the code. This is because i wanted to use this in one of my unifinshed projects for fire, and having static perfect circles didnt seem very alive.

1 Like

This is really impressive! Also, there’s already an extension that does the exact same thing. It’s called lanterns or multilights.

2 Likes

welcome to the community @Soleb244, this is really cool! do you mind if I use this system for a game i’m making? (also you did it right, good job!)

2 Likes

Sure, ill be happy to see something i made be usefull, but as YamJam said, theres an extension that does that, and its propably less laggy. But if you want to have more controll over whats happening or use it with other pallets, then surely use it!

2 Likes

welcome to the forums! @Soleb244

2 Likes