Time for action – detecting when all fruits have been collected
The game file to import and load for this session is 5961_06_10.stencyl
.
Create a new scene called
Level Completed
, with a Background Color of yellow. Leave all the other settings at their default configuration.Close the tab for the newly created scene.
Return to the Score Management scene behavior, and create a new custom event by clicking on + Add Event | Advanced | Custom Event.
In the left-hand panel, rename the custom event to
Fruit Collected
.Add the required instruction blocks to the new Fruit Collected event, so it appears as shown in the following screenshot, again carefully checking the parameters in each of the text boxes:
Note that there is no space in the when FruitCollected happens custom event name.
Save the game and open the Manage Player Collisions actor behavior.
Modify the
Collides with Collectibles
event so it appears as shown in the following screenshot. The changes are listed in the subsequent steps:A new if get...