How to prepare the engine

First of all, you need to install the engine in gamemaker:

Now we must add in the projects the necessary resources:

Sprites:

Objects:

Rooms:

Setting up the engine:

In obj_engine you have to add this scripts

Create Event

- To initialize the engine, we must use this function:
tl_init(smooth_mask, shadow_mask, width, height, quality);
In this way, we have created the surfaces of the engine. The surfaces sizes are equal to width and height, so rendered area has this sizes.
- Now, set the color of the ambient light:
tl_light_ambient(color);
dark colors (c_black, c_gray, c_navy) makes the surface more shadowed than lighting colors (c_white, c_yellow)
- And go to next room: [optional]
room_goto_next();
you can go to next room (before set the obj_engine persistent) to start your game.

End Step Event

- To update all the lights and shadows position:
tl_update();
in this event, the engine, renders in the main surface all the lights and casts all the shadows.

Draw Event

- To draw the main surface in the room:
tl_draw();
in this event, the engine, draws the main surface [ if you want to draw in this surface, you can call the id with tl_get_surface() ].

Game End

- To free the memory:
tl_free();
when you call this function, the engine, destroy all the surfaces and data structures, so if you want to re-use it, you must use tl_init(...).