Increase player hitbox size

scene_man
En Yi 2023-03-06 20:42:30 +08:00
parent ddcb71ed50
commit 92cb1855ba
2 changed files with 7 additions and 7 deletions

View File

@ -192,17 +192,17 @@ static void spawn_player(Scene_t *scene)
p_hitbox->n_boxes = 2;
p_hitbox->boxes[0] = (Rectangle)
{
.x = p_bbox->size.x / 4,
.x = 0,
.y = -1,
.width = p_bbox->size.x / 2,
.width = p_bbox->size.x - 1,
.height = p_bbox->size.y + 2,
};
p_hitbox->boxes[1] = (Rectangle)
{
.x = -1,
.y = p_bbox->size.y / 4,
.width = p_bbox->size.x + 2 ,
.height = p_bbox->size.y / 2,
.y = 0,
.width = p_bbox->size.x + 2,
.height = p_bbox->size.y - 1,
};
}

View File

@ -406,8 +406,8 @@ void player_bbox_update_system(Scene_t *scene)
CHitBoxes_t* p_hitbox = get_component(&scene->ent_manager, p_player, CHITBOXES_T);
p_hitbox->boxes[0].height = p_bbox->size.y + 2;
p_hitbox->boxes[1].y = p_bbox->size.y / 4;
p_hitbox->boxes[1].height = p_bbox->size.y / 2;
//p_hitbox->boxes[1].y = p_bbox->size.y / 4;
p_hitbox->boxes[1].height = p_bbox->size.y - 1;
}
}