Thank you for visiting Blazing Games

Return to the Darkness

There are two things that stand out about this episode. The first is the flashlight and the second is the coin machine that represents the puzzle. Both of them are going to be covered this chapter but first, lets take a look at the flashlight.

This lighting effect looks neat but is actually incredibly simple to implement. It consists of a fairly large movie which acts like a mask though is not technically a mask. It is instead a movie clip with a transparent and translucent portion. The image below is a 1/4 size version of this movie clip. The actual movie is a rather large 1280x960 which is double the horizontal and vertical size of the stage. The registration point of this symbol (the point identified by the coordinates 0, 0) is in the center of the symbol. The reason for all of this is to make sure that the symbol will cover the entire stage no matter where the center of the light is placed on the stage.

The black is actually solid black. The grey is actually transparent. The blue is a partially translucent. It has no green or red in it, 100% (255) blue, and has a 25% alpha channel. In code this would be represented by the number 0x400000FF.

Flashlight Mask

To have the flashlight move, it simply places the center of the movie at the current mouse coordinates which requires two lines of code in the onMouseMove function.

function onMouseMove()
{
view_movie._x = _xmouse;
view_movie._y = _ymouse;
}

Previous page
Chapter 28 Page 4

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2008 Blazing Games Inc. All Rights Reserved