import pygame, sys from pygame.locals import * from pygame.sprite import AbstractGroup obj1 = pygame.Rect((20,50), (50,100)) obj2 = pygame.Rect((10,10), (100,100)) obj3 = pygame.Rect((0,0), (50,50)) print(obj1.colliderect(obj2)) print(obj1.colliderect(obj3)) print(obj2.colliderect(obj3))