Drag the CheckPoint scene into the Level 1 Scene
Place the CheckPoint wherever you like.
Return to the Player Script
Add a variable to keep track of the number of strawberries in the level
Add another variable to track how many strawberries the player has collected.
if the player has collected all the strawberries
Add a general Node to the level scene
Group all of the strawberries under this
This allows a quick way of counting all the instances of strawberries!
Add a reference to this node, then code the ready function
In order emit the trigger signal in the CheckPoint
We must add the CheckPoint to a group called
Return to the CheckPoint Scene
Select the CheckPoint node
Create a new group called checkpoint and add it.
Add a new function called complete_level
If the player has collected all the strawberries
get a reference to the checkpoint node
reset strawberry count to 0
Remember to call the function in process