I want to make it so that when a scene begins, everything is shrouded by darkness. However, there is a small light surrounding the player and the torches so that the player can see something along the way. How do I do that?
Example would be the night mode in Ghost House and Underwater themes in Super Mario Maker 2. The stage is completely dark in this mode, but the player and some other objects like the Starman, fire, fireballs, Boos, and light blocks are either unaffected by the darkness or surrounded by small light.
But turns out in events sheet there is action that changes opacity so you need to set it to 255 (making above step useless so you either change it here or change in above step and delete this action)
Hey guys. I just wanted to update that I’ve found another way to solve the problem by using the dynamic light feature in GDevelop.
When you create a light object, the engine automatically creates another layer called the Lighting layer, which is where all of the light functions work. To make everything dark, you have to go to the Lighting properties in the Lighting layer and set the ambient color to black (0; 0; 0). Afterwards, you can do anything you want. For example, I made it so that when the stage begins, the player character has a little bit of light surrounding them so that the player always knows where their character is.
The other lights in the image above are the brown lights that indicate where the torches are so that the player doesn’t have to search blindly to where they are, and the blue ambient light above.
This image shows the player getting ready to light one of the torches.
When the torch is lit, it reveals everything around them, including the platforms that weren’t there before, and a purple floating enemy that will kill the player if they touch it.
And here are the codes I used for when the light is summoned or unsummoned: