Pygame: colliding rectangles with other rectangles in the same list
问题 I have a list of 10 drawn rectangles (referenced as cubes in my script) that are affected by gravity. I made a simple collision system for them to stop when they hit the ground. How can I make it so when 2 cubes collide they stop falling like they do with the ground? import pygame import time import random pygame.init() clock = pygame.time.Clock() wnx = 800 wny = 600 black = (0,0,0) grey = (75,75,75) white = (255,255,255) orange = (255,100,30) wn = pygame.display.set_mode((wnx, wny)) wn.fill