mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-11 01:14:26 +00:00
just a touch up
This commit is contained in:
parent
5351b91168
commit
b759a0670a
21
lib/init.lua
21
lib/init.lua
@ -58,9 +58,6 @@ function light_world:init(options)
|
||||
self.glowTimer = 0.0
|
||||
self.glowDown = false
|
||||
|
||||
self.drawBackground = function() end
|
||||
self.drawForeground = function() end
|
||||
|
||||
options = options or {}
|
||||
for k, v in pairs(options) do self[k] = v end
|
||||
|
||||
@ -164,14 +161,12 @@ function light_world:drawGlow(l,t,w,h,s)
|
||||
util.drawto(self.glowMap, l, t, s, function()
|
||||
if self.glowDown then
|
||||
self.glowTimer = math.max(0.0, self.glowTimer - love.timer.getDelta())
|
||||
if self.glowTimer == 0.0 then
|
||||
self.glowDown = not self.glowDown
|
||||
end
|
||||
else
|
||||
self.glowTimer = math.min(self.glowTimer + love.timer.getDelta(), 1.0)
|
||||
if self.glowTimer == 1.0 then
|
||||
self.glowDown = not self.glowDown
|
||||
end
|
||||
end
|
||||
|
||||
if self.glowTimer == 1.0 or self.glowTimer == 0.0 then
|
||||
self.glowDown = not self.glowDown
|
||||
end
|
||||
|
||||
for i = 1, #self.body do
|
||||
@ -253,14 +248,6 @@ function light_world:clearBodies()
|
||||
self.isReflection = false
|
||||
end
|
||||
|
||||
function light_world:setBackgroundMethod(fn)
|
||||
self.drawBackground = fn or function() end
|
||||
end
|
||||
|
||||
function light_world:setForegroundMethod(fn)
|
||||
self.drawForeground = fn or function() end
|
||||
end
|
||||
|
||||
-- set ambient color
|
||||
function light_world:setAmbientColor(red, green, blue)
|
||||
self.ambient = {red, green, blue}
|
||||
|
Loading…
Reference in New Issue
Block a user