switches implemented

This commit is contained in:
2022-10-23 14:25:44 +02:00
parent e1f1e0e95c
commit e7db2bf49f
7 changed files with 87 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
--mapa={}
tiletype={void=0,stair=1,half=2,block=3}
tiletype={void=0,stair=1,switch=2,half=3,block=4}
function mapa_new()
for my=0,7 do
@@ -58,6 +58,10 @@ function mapa_set_tile(hab,x,y,tile)
mapa[1+hab][1+x+y*12]=tile
end
function mapa_set_tile_by_index(hab,index,tile)
mapa[1+hab][index]=tile
end
function mapa_get_tile(hab,x,y)
return mapa[1+hab][1+x+y*12]
end
@@ -83,8 +87,10 @@ function check_tile(hab,x,y)
local tile=mapa_get_tile(hab,xx,yy)
if tile<8 then
return tiletype.half
elseif tile<16 then
elseif tile<15 then
return tiletype.stair
elseif tile==15 then
return tiletype.switch
elseif tile<64 then
return tiletype.block
else