From 8790f1d979a4d50fcbe00769b4270a6e03f57f7c Mon Sep 17 00:00:00 2001 From: Joshalosh Date: Mon, 25 Sep 2023 08:37:26 +1000 Subject: [PATCH] Add hitbox offset for UP and DOWN attacks --- feely_pona.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/feely_pona.cpp b/feely_pona.cpp index adf99e4..d8e7ac1 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -501,9 +501,15 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_PlatformInput *input, FP_Ga if (entity->direction == FP_GameDirection_Left) { entity->attack_box_offset = Dqn_V2_InitNx2(entity->local_hit_box_offset.x - entity->attack_box_size.w, entity->local_hit_box_offset.y); - } else { + } else if (entity->direction == FP_GameDirection_Right) { entity->attack_box_offset = Dqn_V2_InitNx2(entity->local_hit_box_offset.x + entity->local_hit_box_size.w, entity->local_hit_box_offset.y); + } else if (entity->direction == FP_GameDirection_Up) { + entity->attack_box_offset = Dqn_V2_InitNx2(entity->local_hit_box_offset.x, + entity->local_hit_box_offset.y - entity->attack_box_size.h); + } else if (entity->direction == FP_GameDirection_Down) { + entity->attack_box_offset = Dqn_V2_InitNx2(entity->local_hit_box_offset.x, + entity->local_hit_box_offset.y + entity->attack_box_size.h); } } else { entity->attack_box_size = {}; -- 2.34.1