Thanks for trying to help me out :) eventually I figured it out. So for anyone with the same problem, this is what I did:
while True: game.update() if food.distance(bomb1) < 40 or food.distance(bomb2) < 40 or food.distance(bomb3) < 40 \ or food.distance(bomb4) < 40 or food.distance(bomb5) < 40: food.goto(random.randint(-250, 250), random.randint(-250, 250)) game.update()I tested it and it works - if the apple spawns too close to the bomb, it will immediately spawn again somewhere else.