From 6ed3f839b1cb960caef9de4d1091942b76216dfd Mon Sep 17 00:00:00 2001 From: Tim Anema Date: Fri, 5 Dec 2014 09:52:16 -0500 Subject: [PATCH] Update README.md --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c57b0ee..08dcaed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -:todoing --add body animations - # light_world.lua 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 local LightWorld = require "lib" --the path to where light_world is (in this repo "lib") --- create light world -lightWorld = LightWorld({ - ambient = {55,55,55}, --the general ambient light in the environment -}) +--create light world +function love.load() + 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() love.graphics.push() love.graphics.translate(x, y) love.graphics.scale(scale) - lightWorld:draw(x,y,scale) + lightWorld:draw(function() + -- do your stuff + end) love.graphics.pop() end ```