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!
- 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 theactive_foodslist. - Call the food’s
draw()method.
- Check whether the player has interacted with the food.
💡 Hint
- Inside the
forloop: - Use the player's method to check for interaction with the food.
🚩 Checkpoint
- A
forloop inside the main game loop. - You can interact with the food.
- All food is drawn onto the screen.
- All your food is visible.