Time to add an Enemy to the level.
Time to add an Enemy to the level.
Create a new scene with a CharacterBody2D as the root.
Create a new scene with a CharacterBody2D as the root.
Rename the scene to Mushroom
Rename the scene to Mushroom
Add an AnimatedSprite2D as a child and import the animations for
Add an AnimatedSprite2D as a child and import the animations for
the death,
the death,
idle and
idle and
run animations.
run animations.
Add a CollisionShape2D and choose the CapsuleShape2D
Add a CollisionShape2D and choose the CapsuleShape2D
Fit it around the centre of the mushroom.
Fit it around the centre of the mushroom.
We are not enclosing the mushroom because we are going to have more collision shapes on different parts of the mushroom
We are not enclosing the mushroom because we are going to have more collision shapes on different parts of the mushroom
top = destroy the mushroom by stomping
top = destroy the mushroom by stomping
sides = hurt the player
sides = hurt the player
Our basic scene tree for the mushroom is:
Our basic scene tree for the mushroom is: