Layer lighting is controlled by Tiled layer properties. You can find these and other reserved Tiled properties in MTE Reserved Tiled Properties 0v910 HTML.htm, in among the rest of the documentation. At the moment the functionality is limited to setting the color/tint of each map layer.
A simple way to flash a sprite would be to change its color when the collision occurs and use a timer to change it back after a short delay. I drew up a quick example in CastleDemo using a touch listener in place of an enemy collision:
local flash = function(event) if event.phase == "began" then print("flash") event.target.lighting = false event.target:setFillColor(255, 0, 0) local unflash = function(object) object.lighting = true object:setFillColor(255, 255, 255) end local closure = function() return unflash(event.target) end local timer = timer.performWithDelay(100, closure, 1) end end player:addEventListener("touch", flash)
In this example a touch event changes the player sprite red and the timer changes it back to its original color. This will also work even if you don’t set lighting = “off” in the sprite’s setup table.