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

Consider how to make bounding boxes better #5

Closed
randomouscrap98 opened this issue Sep 22, 2023 · 1 comment
Closed

Consider how to make bounding boxes better #5

randomouscrap98 opened this issue Sep 22, 2023 · 1 comment

Comments

@randomouscrap98
Copy link
Owner

Right now they're not tied to sprites, which is fine (I don't have the memory to do that and maybe people don't need bounding boxes for most sprites) but how will a person be able to:

  • Create a bounding box easily for a sprite
  • Remove the bounding box for that sprite without resetting everything

For instance, if you have a sprite that's some obstacle and then you break it, the bounding box should go away. The obvious solution is to simply store it in the internal data, it only requires one extra byte. I think that should be left up to the user, as that starts to get a little complicated. Instead, you could add a simple function that's similar to "addSprite" but for bounding boxes.

@randomouscrap98
Copy link
Owner Author

I ended up doing the simple function addBounds and if you want to link it to a sprite that's up to you. Should be as easy as allocating 2 extra bytes in the internal buffer and storing the pointer in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant