diff --git a/conf.lua b/conf.lua index 91544ec..1d08ba6 100644 --- a/conf.lua +++ b/conf.lua @@ -3,6 +3,7 @@ function love.conf(t) t.version = "0.9.0" -- The LÖVE version this game was made for (string) t.console = true -- Attach a console (boolean, Windows only) + --1440 x 900 t.window.title = "Untitled" -- The window title (string) t.window.icon = nil -- Filepath to an image to use as the window's icon (string) t.window.width = 800 -- The window width (number) diff --git a/examples/animation.lua b/examples/animation.lua index fbd4e2c..e1f3e31 100644 --- a/examples/animation.lua +++ b/examples/animation.lua @@ -62,7 +62,7 @@ function love.update(dt) end animation2:update(dt) - lightWorld:update(dt) --only needed for animation + lightWorld:update(dt) lightMouse:setPosition((love.mouse.getX() - x)/scale, (love.mouse.getY() - y)/scale, z) end diff --git a/examples/complex.lua b/examples/complex.lua index 5bded83..b4e4f66 100644 --- a/examples/complex.lua +++ b/examples/complex.lua @@ -235,6 +235,8 @@ function love.update(dt) else lightWorld.post_shader:removeEffect("bloom") end + + lightWorld:update(dt) end function love.draw() diff --git a/examples/gamera.lua b/examples/gamera.lua index 8c54bbe..4a09969 100644 --- a/examples/gamera.lua +++ b/examples/gamera.lua @@ -64,6 +64,7 @@ function love.update(dt) cam:setScale(scale) cam:setPosition(x, y) lightWorld:setTranslation(x, y, scale) + lightWorld:update(dt) end function love.draw() diff --git a/examples/hump.lua b/examples/hump.lua index 5d5d612..29f410a 100644 --- a/examples/hump.lua +++ b/examples/hump.lua @@ -64,6 +64,7 @@ function love.update(dt) cam:lookAt(x, y) cam:zoom(scale) lightWorld:setTranslation(x, y, scale) + lightWorld:update(dt) end function love.draw() diff --git a/examples/normalMap.lua b/examples/normalMap.lua index 8230c55..f7e26f9 100644 --- a/examples/normalMap.lua +++ b/examples/normalMap.lua @@ -48,6 +48,7 @@ function love.update(dt) scale = scale + 0.01 end + lightWorld:update(dt) lightMouse:setPosition(love.mouse.getX()/scale, love.mouse.getY()/scale) end diff --git a/examples/postshaders.lua b/examples/postshaders.lua index e15f947..487dfd0 100644 --- a/examples/postshaders.lua +++ b/examples/postshaders.lua @@ -87,6 +87,7 @@ function love.update(dt) post_shader:removeEffect("chromatic_aberration") end + lightWorld:update(dt) lightMouse:setPosition(love.mouse.getX()/scale, love.mouse.getY()/scale) end diff --git a/examples/short.lua b/examples/short.lua index 20631b4..c238cba 100644 --- a/examples/short.lua +++ b/examples/short.lua @@ -137,6 +137,7 @@ function love.update(dt) lightWorld.post_shader:removeEffect("chromatic_aberration") end + lightWorld:update(dt) lightMouse:setPosition((love.mouse.getX() - x)/scale, (love.mouse.getY() - y)/scale, z) end diff --git a/examples/simple_tiled_impl.lua b/examples/simple_tiled_impl.lua index 4f2e086..4d9314d 100644 --- a/examples/simple_tiled_impl.lua +++ b/examples/simple_tiled_impl.lua @@ -56,6 +56,7 @@ function love.update(dt) end map:update(dt) + lightWorld:update(dt) lightMouse:setPosition((love.mouse.getX() - x)/scale, (love.mouse.getY() - y)/scale, z) end diff --git a/lib/init.lua b/lib/init.lua index 1c0f32a..74a1912 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -85,10 +85,9 @@ end function light_world:update(dt) for i = 1, #self.bodies do - if self.bodies[i]:isInRange(-self.l,-self.t,self.w,self.h,self.s) then + self.bodies[i].is_on_screen = self.bodies[i]:isInRange(-self.l,-self.t,self.w,self.h,self.s) + if self.bodies[i]:isVisible() then self.bodies[i]:update(dt) - else - self.bodies[i].is_on_screen = false end end end