Я хочу, чтобы изображение food_image было размещено случайным образом на background_image.
...
background_image = pygame.image.load('dormitory.jpg')
food_image = pygame.image.load('magazine.jpg')
foodCounter = 0
NEWFOOD = 20
FOODSIZE = 20
foods = []
for i in range(20):
SCREEN.blit(food_image,(random.randint(0, SCREEN_WIDTH - FOODSIZE), random.randint(0, SCREEN_HEIGHT - FOODSIZE), FOODSIZE, FOODSIZE))
playing = True
while playing:
SCREEN.blit(background_image, (0, 0))
foodCounter += 1
if foodCounter >= NEWFOOD:
foodCounter = 0
SCREEN.blit(food_image,(random.randint(0, SCREEN_WIDTH - FOODSIZE),random.randint(0, SCREEN_HEIGHT - FOODSIZE), FOODSIZE, FOODSIZE))