Step 7

Eating the three different foods


Now that we have our three different food types, we need to code the ability to eat them

To do this we need to see if the Player sprite is overlapping with any of the food sprites.

Under Sprites add the shown blocks of code

Checking if we ate a taco


After we detect that we hit a food sprite, we need to check which food we hit.

In here, we need to add an if statment to check if the sprite we hit was a taco

Coding what happens after the taco is eaten


After we eat the taco, we want to do two things

First we want to give the player a point for eating the taco. Then we want to make sure we create a new one, as well as a new badFood