Time for action – decrementing the number of lives
The game file to import and load for this session is 5961_06_04.stencyl
.
If the Game Settings dialog box is still open, click on OK to close it.
Open the Manage Player Collisions actor behavior.
Click on the Collides with Enemies event in the left-hand panel.
Click on the Attributes section button in the palette.
Click on the Game Attributes category button.
Locate the purple set Lives to 0 block under the Number Setters subcategory and drag it into the orange when event so that it appears above the red trigger event RestartLevel in behavior Health for Self block.
Click on the drop-down arrow in the set Lives to … block and select 0 - 0 in the Math section.
In the left textbox of the … - … block, click on the drop-down arrow and select Game Attributes | Lives.
In the right-hand textbox, enter the digit
1
.Locate the print anything block in the Flow section of the palette, under the Debug category, and drag it below the set Lives to Lives – 1 block...