so im making a simple snake game in pygame for food i have designed an apple myself and now i want snake to eat that apple which is actually an image obviously. its just i dont know how to combine that image with random generation of food.
this is the code
foodw = 10
foodh = 10
foodx = random.randint(0, 450)
foody = random.randint(0, 350)
if abs(x - foodx) <20 and abs(y - foody) <20:
scorevalue += 1
foodx = random.randint(30, 470)
foody = random.randint(30, 370)
snklen += 5
food = pygame.image.load('E:/snkae/apple.png')
screen.blit(food, [foodw, foodh])