Hello, Scirra Community !
In this tutorial, i will teach you how to make a dark place and a flashlight.
Preparing the scene
First, you will need a ground and a player.
(I added a ceiling to have a cave like scene)
Then edit their behaviours to have a platform behaviour on the player and a solid one on the ground.
The effect
Preparing the effect
You will need two layers : A "Game" layer ("Background" here) and a "Darkness" layer.
The Darkness layer has special properties that you must edit :
Make it work
On the Darkness layer, make a new Sprite, it will be the penumbra.
Then, on this layer, add another sprite, that will be the light.
And change it blend mode to "Destination Out"
Now make it follow the player with this easy event :
And you have it !
But you can add another light to have a better effect :
I hope you liked this tutorial ;)
You can download the .capx file to test it !