2017-04-20 88 views
1

我怎樣才能找到兩個rects碰撞某一方? (例如rect1.rect.top,rect2.rect.bottom)我試過rect1.rect.colliderect(rect2)pygame.sprite.collide_rect(rect1, rect2),但他們沒有找到單個的側面碰撞。Pygame - Rect相互碰撞

回答

1

沒關係,我找到了答案。 if rect1.rect.bottom >= rect2.rect.top and rect1.rect.bottom <= rect2.rect.bottom: