import pygame import sys from pygame import * object1 = pygame.Rect((20, 50), (50, 100)) object2 = pygame.Rect((10, 10), (100, 100)) object3 = pygame.Rect((0, 0), (50, 50)) display = pygame.display.set_mode((400, 400)) object2 = object1.move(100, 100) print(object1.colliderect(object2)) print(object1.colliderect(object3)) print(object2.colliderect(object3)) while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit pygame.display.update()