mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
Update README.md
This commit is contained in:
parent
2282d9ea33
commit
6ed3f839b1
13
README.md
13
README.md
@ -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),
|
||||||
@ -16,15 +13,23 @@ only it has been largely refactored and edited to allow for scaling and proper t
|
|||||||
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
|
||||||
|
function love.load()
|
||||||
lightWorld = LightWorld({
|
lightWorld = LightWorld({
|
||||||
ambient = {55,55,55}, --the general ambient light in the environment
|
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
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user