switches implemented
This commit is contained in:
10
mapa.lua
10
mapa.lua
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user