The mushroom can be destroyed by
Jumping onto it from above.
To enable this we will create a stomp area
using an Area2D node and a CollisionShape2D
This area will represent the death zone for the mushroom
Use a RectangleShape2D for the CollisionShape2D
Place it at the top of the mushroom as shown.
When the player (body) enters the mushroom at this zone.
We will hurt or kill or destroy the mushroom.
Select the DeathZone node
connect the on_body_entered signal.
In the Mushroom script write code for what happens when the player enters the mushroom death zone.
We subtract 1 from mushroom health.
Create a function to run once the mushrooms health is below 1.
It will raise the mushroom into the air
and play the death animation.
Remember to call this function in process!
We should also disable the collisions on the mushroom
We should also disable the physics process
This is so that the mushroom can be destroyed.
We should only destroy the mushroom once the death animation is finished playing.
Connect the animation finished signal of the AnimatedSprite2D node
If the animation is called death - destroy the mushroom.