Time for action – counting the fruit
The game file to import and load for this session is 5961_06_09.stencyl
.
Open the Score Management scene behavior and create a new number attribute (not a game attribute) with the configuration shown in the following screenshot (in the block palette, click on Attributes, and then click on Create an Attribute…).
Add a new when created event and rename it to
Initialize Fruit Required
.Add the required instruction blocks to the new when created event, so the
Initialize Fruit Required
event appears as shown in the following screenshot, carefully checking the numbers and text in each of the blocks' textboxes:Note that the red of group block in the set actor value … block cannot be found in the palette; it has been dragged into place from the orange for each … of group Collectibles block.
Test the game and look for the Fruit required message in the debug console.
What just happened?
Before we can create the instructions to determine if all the fruit have been collected...