[WIP] El Abad ja arounda mes o menys be. Afegida capacitat per a entrar dins de tiles que el dibuix es només la meitat d'alt
This commit is contained in:
@@ -5,6 +5,18 @@ local arcade_config = require("arcade_config")
|
||||
tiletype={void=0,nonpc=1,stair=2,switch=3,half=4,block=5}
|
||||
mapa.wait=0
|
||||
mapa.step=0
|
||||
|
||||
half_block_set={
|
||||
[20] = true, [21] = true,
|
||||
[22] = true, [28] = true,
|
||||
[29] = true, [36] = true,
|
||||
[37] = true, [44] = true,
|
||||
[45] = true}
|
||||
|
||||
function mapa_is_half_block_tile (ntile)
|
||||
return half_block_set[ntile]==true
|
||||
end
|
||||
|
||||
function mapa_do_backup()
|
||||
mapa_backup={}
|
||||
for i=1,#mapa do
|
||||
@@ -181,7 +193,7 @@ function arc_mapa_get_map_coords ( x, y )
|
||||
return calc_room, calc_col, calc_row
|
||||
end
|
||||
|
||||
function arc_check_tile(world_x,world_y)
|
||||
function arc_get_tile(world_x,world_y)
|
||||
-- local xx=math.min(11,math.max(0,math.floor(x/8)))
|
||||
-- local yy=math.min(5,math.max(0,math.floor(y/8)))
|
||||
--rect(xx*8,yy*8,xx*8+8,yy*8+8,3)
|
||||
@@ -190,8 +202,16 @@ function arc_check_tile(world_x,world_y)
|
||||
-- switch=3 / half=4 / block=5
|
||||
|
||||
local hab, xx, yy = arc_mapa_get_map_coords(world_x, world_y)
|
||||
-- print("ARC_GT= "..hab.."> "..x..", "..y.." => "..tile)
|
||||
local tile=mapa_get_tile(hab,xx,yy)
|
||||
-- print("ARC_CT= "..hab.."> "..x..", "..y.." => "..tile)
|
||||
return tile
|
||||
end
|
||||
|
||||
function arc_check_tile(world_x,world_y)
|
||||
-- tiletype => void=0 / nonpc=1 / stair=2 /
|
||||
-- switch=3 / half=4 / block=5
|
||||
|
||||
local tile=arc_get_tile(world_x, world_y)
|
||||
if tile<8 then
|
||||
return tiletype.half
|
||||
elseif tile<15 then
|
||||
|
||||
Reference in New Issue
Block a user