📜  如何在 pygame 中进行碰撞检测 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:15.996000             🧑  作者: Mango

代码示例1
#making stuff to collide
player=pygame.Rect(whatever you want)
villian=pygame.Rect(whatever you want)

#making the detection
if villian.colliderect(player):
    print ("villian got you oh no!")#this can be something different