
Learning Stencyl 3.x Game Development: Beginner's Guide
By :

The game file that needs to be imported and loaded for this session is 5961_04_15.stencyl
.
Rather than allowing the countdown to continue beyond zero and into negative numbers, in the following steps we're going to create a behavior with an event that will react when the player runs out of time:
Create a new Actor Behavior called Health.
Add a new Time event, Every N Seconds, and rename it to Countdown expired.
Change the do every … seconds textbox to 1
second.
Click on the Flow section button in the palette.
Ensure that the Conditions category button is selected.
Drag the orange if block into the do every 1 seconds event.
Click on the drop-down arrow in the if block, select Comparison, and, in the Inequality section, click on the 0 < 0 block.
In the right-hand textbox of the green 0 < 0 block, enter the number 1
.
In the block palette, click on the Behavior section button and the Attributes category button.
In the For Scene subcategory...
Change the font size
Change margin width
Change background colour