help whit darkness effect

Hi, I want to create the illusion of darkness in my game, the idea is that nothing can be seen unless it is illuminated

Anyone knows how? :frowning:

If you hope to use some decent lighting in your game, I’m afraid you picked the wrong engine.
This is one of the biggest drawbacks of GDevelop. If you want nice, decent lighting effects you are out of luck because GDevelop don’t have a good lighting engine built-in and don’t support blending sprites and layers to make fake lights and “darkness effect” sort of things :frowning:

In native platform you can use a global light to make that kind of effect but you can’t have more than 1 global light in a scene so you can illuminate only a single area of the scene at the time, in case you wish to have multiple light sources that illuminate different areas of the scene, you just can’t do that.

In HTML5 platform the features to blend sprites and layers and make decent fake lights and darkness effect is present in the renderer (Pixi.js) but not implement in GDevelop. In theory you can try to access the renderer and create the effect you need through Javascript but it is require decent knowledge of Javascript, Pixi.js and the GD runtime :frowning:

So, I’m afraid unless you are able to and willing to dig in to the source of GDevelop, there is nothing you can do.
Of course you can try some transparent images or play with transparency of sprites but it is ugly without any kind of blending applied so I can’t really recommend doing it. At least I was unable to get nice results that way.

In case darkness is important in your game, the most realistic thing you can do is pick an other engine.
In GDevelop you won’t have a nice “light in the dark” effect if it what you want…

On native platform : Light extension with global light can be a solution. You can use it in several way, and basically use some sprite in “add” render mode so create false static light (instead of multiple source).

On HTML5 platform : use a black sprite that cover the screen, edit opacity to the level of darkness you want, and create false light source with other sprites objects and the “add” render. No dynamic shadows with this solution, but you can create really cool atmosphere if your graphic skills are good.