Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nyuntaka opened this issue May 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@nyuntaka
Copy link

nyuntaka commented May 6, 2024

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
@nyuntaka nyuntaka added the bug Something isn't working label May 6, 2024
@RafaelBarbosatec
Copy link
Owner

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!

@nyuntaka
Copy link
Author

nyuntaka commented May 7, 2024

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

@nyuntaka
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants