Skip to content

Conversation

@yansnow78
Copy link

@yansnow78 yansnow78 commented Feb 10, 2022

proposal based on pgzhelper
add collide class to do perform plenty of collision test
add some collide functions in class Actor using this collide class:

    def mask_collidepoint(self, pt: _Coordinate):
    def mask_collide(self, actor):
    def mask_collidelist(self, actors):
    def mask_collidelistall(self, actors):

    def circle_collidepoints(self, points: Sequence[_Coordinate],
                             radius: float = None) -> int:
    def circle_collidepoint(self, pt: _Coordinate, radius: float = None) -> bool:
    def circle_collidecircle(self, target: Union[Actor, _Coordinate],
                             radius: float = None, target_radius: float = None) -> bool:
    def circle_collideobb(self, target: Actor, radius: float = None) -> bool:

    def obb_collidepoint(self, pt: _Coordinate) -> bool:
    def obb_colliderect(self, target: Union[Actor, _CanBeRect]):
    def obb_collideobb(self, target: Union[Actor, _CanBeObb]):

compare to pgzhelper, some functions have been renamed, feel free to tell me which function name is the best:
collidepoint_pixel to mask_collidepoint
collide_pixel to mask_collide
collidelist_pixel to mask_collidelist
collidelistall_pixel to mask_collidelistall

@lordmauve lordmauve added the enhancement New feature or request label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants