wip repl
This commit is contained in:
parent
e862b02019
commit
0ed7fc4496
21 changed files with 1267 additions and 148 deletions
|
|
@ -270,6 +270,24 @@ function pxl8.tilemap_check_collision(tilemap, x, y, w, h)
|
|||
return C.pxl8_tilemap_check_collision(tilemap, x, y, w, h)
|
||||
end
|
||||
|
||||
local tile_data = setmetatable({}, {__mode = "k"})
|
||||
|
||||
function pxl8.tilemap_get_tile_data(tilemap, tile_id)
|
||||
if not tilemap or tile_id == 0 then return nil end
|
||||
if not tile_data[tilemap] then return nil end
|
||||
return tile_data[tilemap][tile_id]
|
||||
end
|
||||
|
||||
function pxl8.tilemap_load_ase(tilemap, filepath, layer)
|
||||
return C.pxl8_tilemap_load_ase(tilemap, filepath, layer or 0)
|
||||
end
|
||||
|
||||
function pxl8.tilemap_set_tile_data(tilemap, tile_id, data)
|
||||
if not tilemap or tile_id == 0 then return end
|
||||
if not tile_data[tilemap] then tile_data[tilemap] = {} end
|
||||
tile_data[tilemap][tile_id] = data
|
||||
end
|
||||
|
||||
pxl8.TILE_FLIP_X = 1
|
||||
pxl8.TILE_FLIP_Y = 2
|
||||
pxl8.TILE_SOLID = 4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue