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