Update README.md

This commit is contained in:
Tim Anema 2014-12-05 09:52:16 -05:00
parent 2282d9ea33
commit 6ed3f839b1

View File

@ -1,6 +1,3 @@
:todoing
-add body animations
# light_world.lua # light_world.lua
This is the light modeling done by Priorblue [here](https://bitbucket.org/PriorBlue/love2d-light-and-shadow-engine), This is the light modeling done by Priorblue [here](https://bitbucket.org/PriorBlue/love2d-light-and-shadow-engine),
@ -15,16 +12,24 @@ only it has been largely refactored and edited to allow for scaling and proper t
```lua ```lua
local LightWorld = require "lib" --the path to where light_world is (in this repo "lib") local LightWorld = require "lib" --the path to where light_world is (in this repo "lib")
-- create light world --create light world
lightWorld = LightWorld({ function love.load()
ambient = {55,55,55}, --the general ambient light in the environment lightWorld = LightWorld({
}) ambient = {55,55,55}, --the general ambient light in the environment
})
end
function love.update(dt)
lightWorld:setTranslation(x, y, scale)
end
function love.draw() function love.draw()
love.graphics.push() love.graphics.push()
love.graphics.translate(x, y) love.graphics.translate(x, y)
love.graphics.scale(scale) love.graphics.scale(scale)
lightWorld:draw(x,y,scale) lightWorld:draw(function()
-- do your stuff
end)
love.graphics.pop() love.graphics.pop()
end end
``` ```