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

add some collide functions #281

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

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

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

Successfully merging this pull request may close these issues.

None yet

1 participant