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
21
README.md
21
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),
|
||||||
@ -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
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user