Classes

developer »

gameProject »

pedestrianController »

playerPlatform »

punishment »

team »

Concepts

Libraries

Objects

castLight

Description

Abstract. This is where you should put all your light-emitting related stuff into, as the image data preparation loop will go through all object grid tiles and call this method on any object it finds.

Example

-- taken from game/objects/light_source_base.lua

lightSource.lightColor = color(251, 255, 237, 255)

function lightSource:castLight(imageData, pixelX, pixelY)
	local clr = self.lightColor
	local r, g, b = imageData:getPixel(pixelX, pixelY)
	
	imageData:setPixel(pixelX, pixelY, math.max(r, clr.r), math.max(g, clr.g), math.max(b, clr.b), 255)
end