import pygame import sys pygame.init() displaysurface = pygame.display.set_mode((300, 300)) screen = pygame.display.set_mode((400, 300)) background = pygame.Surface((400,300)) surface = pygame.Surface ((10, 10)) surface.fill ((0, 255 ,0)) pos = [175, 125] object = pygame.Rect ((20, 50), (50, 100)) object2 = pygame.Rect((10, 10), (100, 100)) object3 = pygame.Rect((0, 0), (50, 50)) print(object.colliderect(object2)) print(object.colliderect(object3)) print(object2.colliderect(object3)) object = pygame.Rect((20, 50), (50, 100)) object2 = object.move(100, 100) print(object.topleft) print(object2.topleft) object = pygame.Rect((20, 50), (50, 100)) object.move_ip(100, 100) print(object.topleft) object = pygame.Rect((20, 50), (50, 100)) print(object.collidepoint(50, 75)) object = pygame.Rect ((20, 50), (50, 100)) object2 = pygame.Rect((10, 10), (100, 100)) object3 = pygame.Rect((0, 0), (50, 50)) object4 = pygame.Rect((100, 100), (30, 50)) list = [object4, object3, object2] print(object.collidelist(list)) import pygame object = pygame.Rect((20, 50), (50, 100)) object.update((30, 30), (50, 50)) print(object.topleft) print(object.size) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()