Fairy lights

This commit is contained in:
lustlion
2022-01-20 14:06:40 +01:00
parent 2d8b8a23db
commit ed9873d633
4 changed files with 30 additions and 3 deletions

View File

@@ -19,10 +19,22 @@ function CreateLight(x,y,range,lum,flicker)
o.flicker_speed = flicker_speed or 60/12
o.flicker_time = 0
table.insert(Lights,o)
o.id = #Lights
return o
end
function KillLight(light)
if light.id ~= nil then
for _, e in pairs(Lights) do
if e.id > light.id then
e.id = e.id - 1
end
end
table.remove(Lights,light.id)
end
light = nil
end
function SetDarkness()
love.graphics.setColor(0,0,0,1)
love.graphics.rectangle("fill",0,0,game.width ,game.height)