From 2c93003fe21b71dfca91c6640945da2172afc530 Mon Sep 17 00:00:00 2001 From: JailGamer Date: Sun, 29 Mar 2026 16:39:13 +0200 Subject: [PATCH] Torna a funcionar el entrar dins d'un tile que es mig quan es bota --- data/abad.lua | 10 ++++--- data/game.lua | 74 +++++++++++++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/data/abad.lua b/data/abad.lua index 5161d75..76558b8 100644 --- a/data/abad.lua +++ b/data/abad.lua @@ -211,8 +211,8 @@ function abad_jump() else local tile1_hit = arc_get_tile(x1_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_block2 = mapa_is_half_block_tile(tile2_hit) + local half_block1 = mapa_is_half_block_tile(map_to_editor_tile(tile1_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_block2 = tile2_hit_type == tiletype.block and not half_block2 local full_block = full_block1 and full_block2 @@ -232,7 +232,8 @@ function abad_jump() -- permetre continuar en el salt if not full_block and half_block 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 if abad.jump_in_half_block>0 then abad.y=abad.y-vspace @@ -263,7 +264,8 @@ function abad_land () if can_land then abad.jump_in_half_block_used = false - abad.jump_height = 0 + abad.jump_height = 0 + print("LANDED") end return can_land diff --git a/data/game.lua b/data/game.lua index b3ec6f8..e683856 100644 --- a/data/game.lua +++ b/data/game.lua @@ -220,50 +220,50 @@ function update_game() score.draw() fps_print() - viewp:print() - msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true) - msg_print(0,21,"VIEW= "..vp_x..", "..vp_y, true) - local hab, xx, yy = coords.world_to_tile(abad.x, abad.y) - msg_print(0,28,hab.." ( "..xx..", "..yy.." )", true) + -- viewp:print() + -- msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true) + -- msg_print(0,21,"VIEW= "..vp_x..", "..vp_y, true) + -- local hab, xx, yy = coords.world_to_tile(abad.x, abad.y) + -- msg_print(0,28,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+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.y, 2, 2, 3) - if key.press(key.T) then - view_tile_id = not view_tile_id - view_checking_tile = false - end - if key.press(key.C) then - view_checking_tile = not view_checking_tile - view_tile_id = false - end - - if view_tile_id then - 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+32, 0, true, "R") - - 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+16, 0, true, "L") - write_tile(abad.x+32, abad.y+32, 0, true, "L") - end - - if view_checking_tile then - local msg = "FLIP= true" - if not abad.flip then - msg ="FLIP= false" - view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2) - else - view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2) - end - msg_print(abad.x, abad.y-8,msg) - end + -- if key.press(key.T) then + -- view_tile_id = not view_tile_id + -- view_checking_tile = false + -- end + -- if key.press(key.C) then + -- view_checking_tile = not view_checking_tile + -- view_tile_id = false + -- end + -- + -- if view_tile_id then + -- 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+32, 0, true, "R") + -- + -- 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+16, 0, true, "L") + -- write_tile(abad.x+32, abad.y+32, 0, true, "L") + -- end + -- + -- if view_checking_tile then + -- local msg = "FLIP= true" + -- if not abad.flip then + -- msg ="FLIP= false" + -- view_coord(abad.x+abad.bb.w+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2) + -- else + -- view_coord(abad.x+abad.bb.x-1, abad.y+abad.bb.h-4, 2, 2, 2) + -- end + -- msg_print(abad.x, abad.y-8,msg) + -- end end function msg_print(x, y, msg, direct_print )