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

@@ -132,8 +132,8 @@ end
function abad_state_jumping()
abad.frame=3
abad.wait=abad.wait+1
print(abad.x,1,50)
print(abad.y,10,50)
--print(abad.x,1,50)
--print(abad.y,10,50)
if abad.wait==6 then
abad.wait=0
@@ -146,7 +146,22 @@ function abad_state_jumping()
if abad.y>0 then
if check_tile(abad.hab,abad.x+4,abad.y-2)~=tiletype.block then
if (abad.x+4)&7==0 or check_tile(abad.hab,abad.x+12,abad.y-2)~=tiletype.block then
abad.y=abad.y-2
if check_tile(abad.hab,abad.x+4,abad.y-2)==tiletype.switch then
-- Executar el switch
local xx=min(11,max(0,flr((abad.x+4)/8)))
local yy=min(5,max(0,flr((abad.y-2)/8)))
switches.start(abad.hab,1+xx+yy*12)
--cls(4)
elseif (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y-2)==tiletype.switch then
-- Executar el switch
local xx=min(11,max(0,flr((abad.x+12)/8)))
local yy=min(5,max(0,flr((abad.y-2)/8)))
switches.start(abad.hab,1+xx+yy*12)
--cls(4)
else
abad.y=abad.y-2
end
end
end
else