How do I make a dynamic lightning system?

  • How can I make a dynamic lightning system for a sandbox game ?

    I want to make something like Terraria :

    I use a tilemap and I tried a lot of thing but I still have problem with performance.

    If someone can help me .. Thanks

  • Dynamic lightning is always more difficult than it seems at first, you need skills on programming.

    I´m not sure how to achieve this, but, what about setting an array with black tiles, and then, turn their opacity by checking distance to player.

    A simple grid that can not only check distance to player but also check if its another object in it, for example, dirt or water or nothing, so you can turn the opacity in order of qhat is colliding

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You could indeed use a black tilemap on top that is exactly the same size as the viewport - and scrolls with the viewport itself. Then use math to figure out where you're at on the layout and turn the black tiles "on and off" accordingly based on your light position.

    ~Sol

  • Not sure if you've seen this but you might want to check this tutorial out.

    Subscribe to Construct videos now

    It's not what your looking for but it could help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)