L'Abad ja es mou per les escales

This commit is contained in:
2026-03-27 16:24:21 +01:00
parent 81205b0f8e
commit 2dbf0bb8b7

View File

@@ -260,7 +260,7 @@ function abad_advance()
abad.x=abad.x+step_length
end
if arc_check_tile(abad.x+abad.bb.x,abad.y+abad.bb.h)==tiletype.stair then
if arc_check_tile(x_check,y_check)==tiletype.stair then
abad.update=abad_state_stairs
elseif abad.update==abad_state_stairs then
abad.update=abad_state_normal
@@ -456,6 +456,10 @@ function abad_state_stairs()
abad.frame=4
abad.wait=abad.wait+1
local x1_check = abad.x+abad.bb.x
local x2_check = abad.x+abad.bb.x+abad.bb.w-1
local y_check = abad.y+abad.bb.h-1
if key.down(keyRight) or pad.down(btnRight) then
abad.flip=false
abad_advance()
@@ -465,14 +469,14 @@ function abad_state_stairs()
abad_advance()
if abad.wait==6 then sound.play(audio_low) end
elseif key.down(keyUp) or pad.down(btnUp) then
if arc_check_tile(abad.x+4,abad.y+8)==tiletype.stair and
arc_check_tile(abad.x+12,abad.y+8)==tiletype.stair then
if arc_check_tile(x1_check,y_check)==tiletype.stair and
arc_check_tile(x2_check,y_check)==tiletype.stair then
abad.y=abad.y-1
if abad.wait==6 then sound.play(audio_low) end
end
elseif key.down(keyDown) or pad.down(btnDown) then
if arc_check_tile(abad.x+4,abad.y+abad.bb.h)==tiletype.stair and
arc_check_tile(abad.x+12,abad.y+abad.bb.h)==tiletype.stair then
if arc_check_tile(x1_check,y_check)==tiletype.stair and
arc_check_tile(x2_check,y_check)==tiletype.stair then
abad.y=abad.y+1
if abad.wait==6 then sound.play(audio_low) end
end