[FIX] Al acabar una escala cap amunt botava
[FIX] Al botar i caure en un escala, no parava en l'escala i caia
This commit is contained in:
+19
-2
@@ -45,6 +45,7 @@ function abad_init()
|
||||
mustep=1,
|
||||
stairs_flip=false,
|
||||
stairs_moves=0, --contador de moviments dins de les escales
|
||||
exited_stairs = 0,
|
||||
draw=abad.draw,
|
||||
hurting=0,
|
||||
update=nil,
|
||||
@@ -292,7 +293,7 @@ function abad_land ()
|
||||
-- Comprovar on està aterrant
|
||||
local tile1_hit= arc_check_tile(x1_check, y_check )
|
||||
local tile2_hit= arc_check_tile(x2_check, y_check)
|
||||
local floor_tile = tile1_hit>=tiletype.half or tile2_hit>=tiletype.half
|
||||
local floor_tile = tile1_hit>=tiletype.half or tile2_hit>=tiletype.half or tile1_hit==tiletype.stair or tile2_hit==tiletype.stair
|
||||
|
||||
-- Encara que siga un tile de piso s'ha de comprovar que
|
||||
-- la y es un múltiple de l'alt dels tiles
|
||||
@@ -430,21 +431,35 @@ function abad_state_normal()
|
||||
abad_make_safe()
|
||||
|
||||
if abad_in_stairs(0,-1) and controller:check("up") then
|
||||
abad.exited_stairs = 0
|
||||
abad.update=abad_state_stairs
|
||||
elseif controller:check("down") then
|
||||
abad.exited_stairs = 0
|
||||
abad_move_down()
|
||||
elseif controller:check("right") then
|
||||
abad.exited_stairs = 0
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=false
|
||||
elseif controller:check("left") then
|
||||
abad.exited_stairs = 0
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=true
|
||||
elseif controller:check("jump") then
|
||||
abad_do_jump()
|
||||
if abad.exited_stairs ==0 then
|
||||
abad_do_jump()
|
||||
else
|
||||
abad.exited_stairs = abad.exited_stairs - 1
|
||||
if abad.exited_stairs<0 then
|
||||
abad.exited_stairs = 0
|
||||
end
|
||||
end
|
||||
--elseif btn(KEY_Z) then
|
||||
-- abad.respawning=240
|
||||
elseif controller:check("shoot") then
|
||||
abad.exited_stairs = 0
|
||||
abad_shot_cacau()
|
||||
else
|
||||
abad.exited_stairs = 0
|
||||
end
|
||||
end
|
||||
|
||||
@@ -600,6 +615,7 @@ end
|
||||
function abad_state_stairs()
|
||||
abad.frame=4
|
||||
abad.wait=abad.wait+1
|
||||
abad.exited_stairs = 0
|
||||
local moved = false
|
||||
|
||||
if controller:check("right") then
|
||||
@@ -615,6 +631,7 @@ function abad_state_stairs()
|
||||
abad.y=abad.y-1
|
||||
moved = true
|
||||
else
|
||||
abad.exited_stairs = 20
|
||||
abad.update=abad_state_normal
|
||||
abad.frame=0
|
||||
end
|
||||
|
||||
@@ -126,7 +126,7 @@ function stages.stage1_boss_outro_update()
|
||||
end
|
||||
|
||||
function stages.stage1_boss_outro_end()
|
||||
local abad_x, abad_y = coords.room_to_world ( 54, 8, 3 )
|
||||
local abad_x, abad_y = coords.room_to_world ( 54, 9, 3 )
|
||||
abad:move(abad_x, abad_y)
|
||||
abad_make_safe( true )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user