karai17/Simple-Tiled-Implementation — pull request #42 by WetDesertRock (2014-09-19 04:54:23+00:00)
Title: Add in a method for dynamic tiles.

You have to do map:update(dt) every frame to use this. Adds a layer.meta which mirrors the the layer.data, but with unique values for each tile.

Sorry about the ugly diff, my editor decided to fix up all of your empty lines with the correct indentation level. Here is a usage example. I only wanted to modify the tile offset, so that is the only thing you can change right now. Requires flux to run. Notice how every update to the offset I do a tile.dirty = true.

```lua
local sti = require("sti")
local flux = require("flux")

function love.load()
map = sti.new("testmap")

for i=0,20 do
local x = love.math.random(25)
local y = love.math.random(25)

local tile = map.layers[1].meta[y][x]
flux.to(tile.offset,2,{y=tile.offset.y+500}):onupdate(function() tile.dirty=true end)
end
end

function love.update(dt)
map:update(dt)
flux.update(dt)
end
function love.draw()
map:draw()
end
```