首页 文章

Pygame - Rect侧面碰撞

提问于
浏览
1

如何判断两个部分是否在某一侧发生碰撞? (例如rect1.rect.top,rect2.rect.bottom)我试过 rect1.rect.colliderect(rect2)pygame.sprite.collide_rect(rect1, rect2) ,但他们没有找到单独的侧面碰撞 .

1 回答

  • 1

    没关系,我找到了答案 . if rect1.rect.bottom >= rect2.rect.top and rect1.rect.bottom <= rect2.rect.bottom:

相关问题