📜  pygame rect 碰撞 - Python 代码示例

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

代码示例1
#For detecting collisions in pygame
Rect1 = pg.Rect(x, y, width, height)
Rect2 = pg.Rect(x, y, width, height)
if Rect1.colliderect(Rect2):
  #Do something