Clash of elves pygame left

I want to make special collisions with pygame. I have a sprite Balland BlockI want to know which side of the block the ball collided with.

Perhaps this is possible with pygame.sprite.groupcollide()custom collidedas they call it. But I did not find the answer to this question. Is there any way to do this?

+4
source share
2 answers

Yes it is possible. You are also right in the conflict of arguments.

What you need to do is write a function that takes 2 sprites and returns a boolean value.

, , , true, .

rect, , , , .

, , A, B , , . , A , A.

+2

pygame, :

pygame

, :

pygame.sprite.spritecollide()

pygame, . ,

pygame.sprite.collide_mask()

, :

" , , None, .

, . "", , . * collide. "" "".

, . , , , ".

, .

-Harry

+1

All Articles