RafaelBarbosatec/bonfire

[Bug]: When adding multiple HitBoxes, the second and subsequent tests are incorrect

Closed this issue · 3 comments

What happened?

When adding multiple HitBoxes, the second and subsequent tests are incorrect. I think this is a bug.
hitbox0r
hitbox1r
hitbox2r

Steps to reproduce?

CollisionMapComponent collis = CollisionMapComponent(
      position: Vector2.zero(),
      size: Vector2.zero(),
      collisions: [
        RectangleHitbox(
          position: Vector2.all(200),
          size: Vector2.all(100),
        ),
        RectangleHitbox(
          position: Vector2.all(300),
          size: Vector2.all(100),
        ),
        CircleHitbox(
          radius: 50,
          position: Vector2.all(400),
        )
      ],
    );

    return LayoutBuilder(
      builder: (context, constraints) {
        return BonfireWidget(
          components: [collis],
          showCollisionArea: true,
          ...

This bug also occurs with GameComponent other than CollisionMapComponent.

What did you expect to happen?

I think the second and subsequent ones should have the same result as the first.

Bonfire version

3.8.5

Relevant log output

No response

Hi @nyuntaka !
Thanks for this issue.
In the moment I consider only the first hotbox to handle collision. I will try improve this point.
Thank you!

Until then, I will instead use multiple GameDecorations with one HitBox added.
Thank you.

I was able to confirm that it was fixed.
thank you very much.