Torna a funcionar el entrar dins d'un tile que es mig quan es bota
This commit is contained in:
@@ -211,8 +211,8 @@ function abad_jump()
|
|||||||
else
|
else
|
||||||
local tile1_hit = arc_get_tile(x1_check, y_check )
|
local tile1_hit = arc_get_tile(x1_check, y_check )
|
||||||
local tile2_hit = arc_get_tile(x2_check, y_check)
|
local tile2_hit = arc_get_tile(x2_check, y_check)
|
||||||
local half_block1 = mapa_is_half_block_tile(tile1_hit)
|
local half_block1 = mapa_is_half_block_tile(map_to_editor_tile(tile1_hit))
|
||||||
local half_block2 = mapa_is_half_block_tile(tile2_hit)
|
local half_block2 = mapa_is_half_block_tile(map_to_editor_tile(tile2_hit))
|
||||||
local full_block1 = tile1_hit_type == tiletype.block and not half_block1
|
local full_block1 = tile1_hit_type == tiletype.block and not half_block1
|
||||||
local full_block2 = tile2_hit_type == tiletype.block and not half_block2
|
local full_block2 = tile2_hit_type == tiletype.block and not half_block2
|
||||||
local full_block = full_block1 and full_block2
|
local full_block = full_block1 and full_block2
|
||||||
@@ -232,7 +232,8 @@ function abad_jump()
|
|||||||
-- permetre continuar en el salt
|
-- permetre continuar en el salt
|
||||||
if not full_block and half_block then
|
if not full_block and half_block then
|
||||||
if abad.jump_in_half_block==0 and not abad.jump_in_half_block_used then
|
if abad.jump_in_half_block==0 and not abad.jump_in_half_block_used then
|
||||||
abad.jump_in_half_block = arcade_config.tiles_height>>1
|
abad.jump_in_half_block = arcade_config.tiles_height / 2
|
||||||
|
-- print(abad.jump_in_half_block)
|
||||||
end
|
end
|
||||||
if abad.jump_in_half_block>0 then
|
if abad.jump_in_half_block>0 then
|
||||||
abad.y=abad.y-vspace
|
abad.y=abad.y-vspace
|
||||||
@@ -263,7 +264,8 @@ function abad_land ()
|
|||||||
|
|
||||||
if can_land then
|
if can_land then
|
||||||
abad.jump_in_half_block_used = false
|
abad.jump_in_half_block_used = false
|
||||||
abad.jump_height = 0
|
abad.jump_height = 0
|
||||||
|
print("LANDED")
|
||||||
end
|
end
|
||||||
|
|
||||||
return can_land
|
return can_land
|
||||||
|
|||||||
@@ -220,50 +220,50 @@ function update_game()
|
|||||||
score.draw()
|
score.draw()
|
||||||
|
|
||||||
fps_print()
|
fps_print()
|
||||||
viewp:print()
|
-- viewp:print()
|
||||||
msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true)
|
-- msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true)
|
||||||
msg_print(0,21,"VIEW= "..vp_x..", "..vp_y, true)
|
-- msg_print(0,21,"VIEW= "..vp_x..", "..vp_y, true)
|
||||||
local hab, xx, yy = coords.world_to_tile(abad.x, abad.y)
|
-- local hab, xx, yy = coords.world_to_tile(abad.x, abad.y)
|
||||||
msg_print(0,28,hab.." ( "..xx..", "..yy.." )", true)
|
-- msg_print(0,28,hab.." ( "..xx..", "..yy.." )", true)
|
||||||
-- msg_print(0,35,hab.." ( "..xx..", "..yy.." )", true)
|
-- msg_print(0,35,hab.." ( "..xx..", "..yy.." )", true)
|
||||||
msg_print(0,42," JH= "..abad.jump_height,true)
|
-- msg_print(0,42," JH= "..abad.jump_height,true)
|
||||||
|
|
||||||
-- view_coord(abad.x+8, abad.y+0, 16, 32, 6)
|
-- view_coord(abad.x+8, abad.y+0, 16, 32, 6)
|
||||||
-- view_coord(abad.x+abad.bb.x, abad.y+abad.bb.h, 2, 2, 4)
|
-- view_coord(abad.x+abad.bb.x, abad.y+abad.bb.h, 2, 2, 4)
|
||||||
-- view_coord(abad.x+abad.bb.x+abad.bb.w, abad.y+abad.bb.h, 2, 2, 2)
|
-- view_coord(abad.x+abad.bb.x+abad.bb.w, abad.y+abad.bb.h, 2, 2, 2)
|
||||||
-- view_coord(abad.x, abad.y, 2, 2, 3)
|
-- view_coord(abad.x, abad.y, 2, 2, 3)
|
||||||
|
|
||||||
if key.press(key.T) then
|
-- if key.press(key.T) then
|
||||||
view_tile_id = not view_tile_id
|
-- view_tile_id = not view_tile_id
|
||||||
view_checking_tile = false
|
-- view_checking_tile = false
|
||||||
end
|
-- end
|
||||||
if key.press(key.C) then
|
-- if key.press(key.C) then
|
||||||
view_checking_tile = not view_checking_tile
|
-- view_checking_tile = not view_checking_tile
|
||||||
view_tile_id = false
|
-- view_tile_id = false
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
if view_tile_id then
|
-- if view_tile_id then
|
||||||
write_tile(abad.x, abad.y, 0, true, "R")
|
-- write_tile(abad.x, abad.y, 0, true, "R")
|
||||||
write_tile(abad.x, abad.y+16, 0, true, "R")
|
-- write_tile(abad.x, abad.y+16, 0, true, "R")
|
||||||
write_tile(abad.x, abad.y+32, 0, true, "R")
|
-- write_tile(abad.x, abad.y+32, 0, true, "R")
|
||||||
|
--
|
||||||
write_tile(abad.x+16, abad.y+32, 0, true, "C")
|
-- write_tile(abad.x+16, abad.y+32, 0, true, "C")
|
||||||
|
--
|
||||||
write_tile(abad.x+32, abad.y, 0, true, "L")
|
-- write_tile(abad.x+32, abad.y, 0, true, "L")
|
||||||
write_tile(abad.x+32, abad.y+16, 0, true, "L")
|
-- write_tile(abad.x+32, abad.y+16, 0, true, "L")
|
||||||
write_tile(abad.x+32, abad.y+32, 0, true, "L")
|
-- write_tile(abad.x+32, abad.y+32, 0, true, "L")
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
if view_checking_tile then
|
-- if view_checking_tile then
|
||||||
local msg = "FLIP= true"
|
-- local msg = "FLIP= true"
|
||||||
if not abad.flip then
|
-- if not abad.flip then
|
||||||
msg ="FLIP= false"
|
-- msg ="FLIP= false"
|
||||||
view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
-- view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||||
else
|
-- else
|
||||||
view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
-- view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2)
|
||||||
end
|
-- end
|
||||||
msg_print(abad.x, abad.y-8,msg)
|
-- msg_print(abad.x, abad.y-8,msg)
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
function msg_print(x, y, msg, direct_print )
|
function msg_print(x, y, msg, direct_print )
|
||||||
|
|||||||
Reference in New Issue
Block a user