This code snippet can be used to have food that your character can eat, and gain health from.
To set this up, you will need a health variable. The bite sound is optional, but can be found in the standard scratch library
The code works by constantly checking if the sprite is touching the food sprite. If it is, it will increase the health, make a biting sound, and then broadcast an eat message. This broadcast then makes the food sprite hide.
The code can be found here: