Darkness and Flashlight

7

Attached Files

The following files have been attached to this tutorial:

.capx

Stats

6,556 visits, 10,006 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 22 Jan, 2016. Last updated 19 Feb, 2019

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 !

.CAPX
  • 3 Comments

  • Order by
Want to leave a comment? Login or Register an account!