I want a code that whenever the player and the fruit collide... to just end the game.
player:
playerImg = pygame.image.load('trash.png')
x = 370
y = 480
def player(x, y):
screen.blit(playerImg, (x, y))
fruit1:
fruitImg = pygame.image.load('001-apple.png')
fruit_x = random.randrange(0, width)
fruit_y = -600
fruit_speed = 5
fruit_width = 100
fruit_height = 100
def fruit(fruit_x, fruit_y, fruit_width, fruit_height):
screen.blit(fruitImg, (fruit_x, fruit_y, fruit_width, fruit_height))