Task 4.5: Draw Active Foods in Game Loop

Now that each Food knows how to draw itself, it's time to actually draw all the food onto your game window during the game!

  1. Draw each active food item onto the screen by looping through all active foods inside your while running: game loop.

💡 Hint

  • Create a loop inside your while running: loop to iterate over the active_foods list.
  • Call the food’s draw() method.
  1. Check whether the player has interacted with the food.

💡 Hint

  • Inside the for loop:
    • Use the player's method to check for interaction with the food.

🚩 Checkpoint

  • A for loop inside the main game loop.
  • You can interact with the food.
  • All food is drawn onto the screen.
  • All your food is visible.