feat: changed size of character hitboxes

This commit is contained in:
Sara 2024-01-16 17:19:50 +01:00
parent 70d9c93f63
commit c66a8d8705
2 changed files with 10 additions and 10 deletions

View file

@ -61,11 +61,11 @@ Enemy* MakeEnemy() {
self->rigidbody = rigidbody_make(Enemy_as_PhysicsEntity(self));
self->collider = collider_new(Enemy_as_PhysicsEntity(self), shape_new_square(MakeVector(0.2f, 0.05f)), 0,
PHYSICS_LAYER_DEFAULT, PHYSICS_LAYER_DEFAULT);
self->collider = collider_new(Enemy_as_PhysicsEntity(self), shape_new((Vector[]){
MakeVector(-0.2f, -0.95f),
MakeVector( 0.2f, -0.95f),
MakeVector( 0.2f, 0.0f),
MakeVector(-0.2f, 0.0f),
self->hitbox = collider_new(Enemy_as_PhysicsEntity(self), shape_new((Vector[]){
MakeVector(-0.1f, -0.9f),
MakeVector( 0.1f, -0.9f),
MakeVector( 0.1f, 0.0f),
MakeVector(-0.1f, 0.0f),
}, 4), 1, PHYSICS_LAYER_COMBAT, 0x0);
PhysicsEntity pe = Enemy_as_PhysicsEntity(self);
LOG_INFO("enemy instantiated mirroring as: %s", pe.mirror->get_typestring(pe.data));

View file

@ -98,11 +98,11 @@ Player* MakePlayer() {
MakeVector(-0.2f, 0.065f)
}, 4), 0, PHYSICS_LAYER_CHARACTERS, PHYSICS_LAYER_DEFAULT);
self->hitbox = collider_new(Player_as_PhysicsEntity(self), shape_new((Vector[]){
MakeVector(-0.2f, -0.95f),
MakeVector( 0.2f, -0.95f),
MakeVector( 0.2f, 0.00f),
MakeVector(-0.2f, 0.00f)
}, 3), 1, PHYSICS_LAYER_COMBAT, 0x0);
MakeVector(-0.1f, -0.9f),
MakeVector( 0.1f, -0.9f),
MakeVector( 0.1f, 0.00f),
MakeVector(-0.1f, 0.00f)
}, 4), 1, PHYSICS_LAYER_COMBAT, 0x0);
sprite_set_origin(self->sprite, MakeVector(0.45f, 0.925f));