You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, I would like feedback on this code snippet, do you think creating the two mixins is the best approach? I'm not sure as of right now because dart-lang/language#540 is open still, and that would mean if a user wanted to use the RayCastToMouse mixin, the mixins in the Forge2DGame would look a bit like:
Also, I would like feedback on this code snippet, do you think creating the two mixins is the best approach? I'm not sure as of right now because dart-lang/language#540 is open still, and that would mean if a user wanted to use the RayCastToMouse mixin, the mixins in the Forge2DGame would look a bit like:
It looks like they could be components instead of mixins.
Another thing, make sure you don't create any new Ray2Vector2 or Paint objects in the update or render methods, since that will hurt performance. Since they are mutable you can just set them outside of the method or in onLoad and then do changes to them within the update/render method if needed, so that the same objects always are used instead of creating new ones.
What could be improved
For Flame_Forge2D there could exist a mixin that helps users to actually see the
Ray2
in the screen.Why should this be improved
This could help people debug
HitBox
es easier.Any risks?
I don't believe that anything is a risk here.
More information
Here is an example using the code below.
20230511_080724.mp4
Here is an example of what could be written (copied from raycast_example.dart):
The text was updated successfully, but these errors were encountered: