Your browser doesn't support HTML5 canvas.

Directional lighting of textures.

This tech demo just lights the tiles dynamically changing how the light casts a shadow on the texture on the walls.

Controls:

Just the mouse

How it works:
This times 8:
dir = point_direction(x,y,obj_light.x,obj_light.y)+45

draw_set_alpha(1)
draw_sprite(spr_tile,0,x,y)

thisvalue = ((dir-45)/90);
if (thisvalue <= -2) {thisvalue = 1-(thisvalue+3)}
if (thisvalue > 1) {thisvalue = 2-thisvalue }
if (thisvalue > 2) {thisvalue = 0}
draw_set_alpha(thisvalue)
draw_sprite(spr_tile,3,x,y)