Increase player hitbox size
parent
ddcb71ed50
commit
92cb1855ba
|
@ -192,17 +192,17 @@ static void spawn_player(Scene_t *scene)
|
||||||
p_hitbox->n_boxes = 2;
|
p_hitbox->n_boxes = 2;
|
||||||
p_hitbox->boxes[0] = (Rectangle)
|
p_hitbox->boxes[0] = (Rectangle)
|
||||||
{
|
{
|
||||||
.x = p_bbox->size.x / 4,
|
.x = 0,
|
||||||
.y = -1,
|
.y = -1,
|
||||||
.width = p_bbox->size.x / 2,
|
.width = p_bbox->size.x - 1,
|
||||||
.height = p_bbox->size.y + 2,
|
.height = p_bbox->size.y + 2,
|
||||||
};
|
};
|
||||||
p_hitbox->boxes[1] = (Rectangle)
|
p_hitbox->boxes[1] = (Rectangle)
|
||||||
{
|
{
|
||||||
.x = -1,
|
.x = -1,
|
||||||
.y = p_bbox->size.y / 4,
|
.y = 0,
|
||||||
.width = p_bbox->size.x + 2,
|
.width = p_bbox->size.x + 2,
|
||||||
.height = p_bbox->size.y / 2,
|
.height = p_bbox->size.y - 1,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
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[0].height = p_bbox->size.y + 2;
|
||||||
p_hitbox->boxes[1].y = p_bbox->size.y / 4;
|
//p_hitbox->boxes[1].y = p_bbox->size.y / 4;
|
||||||
p_hitbox->boxes[1].height = p_bbox->size.y / 2;
|
p_hitbox->boxes[1].height = p_bbox->size.y - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue