[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:
+18
-1
@@ -45,6 +45,7 @@ function abad_init()
|
|||||||
mustep=1,
|
mustep=1,
|
||||||
stairs_flip=false,
|
stairs_flip=false,
|
||||||
stairs_moves=0, --contador de moviments dins de les escales
|
stairs_moves=0, --contador de moviments dins de les escales
|
||||||
|
exited_stairs = 0,
|
||||||
draw=abad.draw,
|
draw=abad.draw,
|
||||||
hurting=0,
|
hurting=0,
|
||||||
update=nil,
|
update=nil,
|
||||||
@@ -292,7 +293,7 @@ function abad_land ()
|
|||||||
-- Comprovar on està aterrant
|
-- Comprovar on està aterrant
|
||||||
local tile1_hit= arc_check_tile(x1_check, y_check )
|
local tile1_hit= arc_check_tile(x1_check, y_check )
|
||||||
local tile2_hit= arc_check_tile(x2_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
|
-- Encara que siga un tile de piso s'ha de comprovar que
|
||||||
-- la y es un múltiple de l'alt dels tiles
|
-- la y es un múltiple de l'alt dels tiles
|
||||||
@@ -430,21 +431,35 @@ function abad_state_normal()
|
|||||||
abad_make_safe()
|
abad_make_safe()
|
||||||
|
|
||||||
if abad_in_stairs(0,-1) and controller:check("up") then
|
if abad_in_stairs(0,-1) and controller:check("up") then
|
||||||
|
abad.exited_stairs = 0
|
||||||
abad.update=abad_state_stairs
|
abad.update=abad_state_stairs
|
||||||
elseif controller:check("down") then
|
elseif controller:check("down") then
|
||||||
|
abad.exited_stairs = 0
|
||||||
abad_move_down()
|
abad_move_down()
|
||||||
elseif controller:check("right") then
|
elseif controller:check("right") then
|
||||||
|
abad.exited_stairs = 0
|
||||||
abad.update=abad_state_walking
|
abad.update=abad_state_walking
|
||||||
abad.flip=false
|
abad.flip=false
|
||||||
elseif controller:check("left") then
|
elseif controller:check("left") then
|
||||||
|
abad.exited_stairs = 0
|
||||||
abad.update=abad_state_walking
|
abad.update=abad_state_walking
|
||||||
abad.flip=true
|
abad.flip=true
|
||||||
elseif controller:check("jump") then
|
elseif controller:check("jump") then
|
||||||
|
if abad.exited_stairs ==0 then
|
||||||
abad_do_jump()
|
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
|
--elseif btn(KEY_Z) then
|
||||||
-- abad.respawning=240
|
-- abad.respawning=240
|
||||||
elseif controller:check("shoot") then
|
elseif controller:check("shoot") then
|
||||||
|
abad.exited_stairs = 0
|
||||||
abad_shot_cacau()
|
abad_shot_cacau()
|
||||||
|
else
|
||||||
|
abad.exited_stairs = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -600,6 +615,7 @@ end
|
|||||||
function abad_state_stairs()
|
function abad_state_stairs()
|
||||||
abad.frame=4
|
abad.frame=4
|
||||||
abad.wait=abad.wait+1
|
abad.wait=abad.wait+1
|
||||||
|
abad.exited_stairs = 0
|
||||||
local moved = false
|
local moved = false
|
||||||
|
|
||||||
if controller:check("right") then
|
if controller:check("right") then
|
||||||
@@ -615,6 +631,7 @@ function abad_state_stairs()
|
|||||||
abad.y=abad.y-1
|
abad.y=abad.y-1
|
||||||
moved = true
|
moved = true
|
||||||
else
|
else
|
||||||
|
abad.exited_stairs = 20
|
||||||
abad.update=abad_state_normal
|
abad.update=abad_state_normal
|
||||||
abad.frame=0
|
abad.frame=0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ function stages.stage1_boss_outro_update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function stages.stage1_boss_outro_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:move(abad_x, abad_y)
|
||||||
abad_make_safe( true )
|
abad_make_safe( true )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user