如何判断两个矩形在某一侧是否发生碰撞? (例如 rect1.rect.top、rect2.rect.bottom)我尝试过 rect1.rect.collideect(rect2)
和 pygame.sprite.collide_rect(rect1, rect2)
,但他们没有找到单独的侧面碰撞。
最佳答案
没关系,我找到了答案。 if rect1.rect.bottom >= rect2.rect.top and rect1.rect.bottom <= rect2.rect.bottom:
关于python - Pygame - 矩形并排碰撞,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43522463/