Fairy lights
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user