Darkness and Flashlight

  • 14 favourites

Attached Files

The following files have been attached to this tutorial:

.capx

darkness.capx

Download now 293 KB

Stats

1,888 visits, 2,733 views

Translations

This tutorial hasn't been translated.

Tools

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

darkness.capx

Download now 293 KB
  • 0 Comments

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