shnewto / bevy_collider_gen

a library for generating 2D colliders for bevy apps from images
Apache License 2.0
89 stars 6 forks source link

Refactor of code #22

Closed salam99823 closed 1 week ago

salam99823 commented 2 weeks ago

Changes:

Added:

Moved:

Removed:

Other

salam99823 commented 2 weeks ago

Hi, what do you think about the latest commit to dev branch.

shnewto commented 2 weeks ago

Hello @salam99823! There's a lot of really useful refactors here and thank you for updating the rapier2d example to use linear velocity instead of just moving the sprite to new pixels 🙃

Regarding the changes in your PR here (your main branch). I'm on totally board, they're good changes. My initial implementation had in mind a kind of "drop a new physics framework into the collider directory" and be up and running, but it only adds noise, it's just as easy to drop a new framework into the src directory.

Regarding the changes in your dev branch, those are good changes too but they took me a minute to think about. Looking at your code, it's clear that using generate_multi_collider and generate_collider instead of individual symbols for every collider makes the code cleaner and more light weight. Initially I liked the experience of being able to write generate_ and tab complete in the editor the collider you were looking for. But again, it's not harder to use ColliderType, it actually makes it much clearer to the user what colliders are supported.

All that said, both branches are changes I'll be very glad to incorporate into this project. Thank you for all the time you've given to this and the edges project.

I'll hold off on merging in case you're thinking you'll update your main branch with your dev changes.

shnewto commented 2 weeks ago

@salam99823 is this ready for review?

salam99823 commented 2 weeks ago

Hello @shnewto! Yes, I think it can be released as a new version.

shnewto commented 1 week ago

@salam99823 thank you again for these substantial and very positive refactors!

salam99823 commented 1 week ago

I'm glad you liked it.