Time for action – creating a countdown timer
The game file that needs to be imported and loaded for this session is 5961_04_14.stencyl
.
Ensure that the game has been saved, and close any open tabs, leaving only the Dashboard tab visible. Now execute the following instructions to create the countdown timer:
Create a new Scene Behavior called Score Management.
Click on the Attributes section button in the instruction block palette.
Click on the Create an Attribute button, situated immediately below the category buttons.
In the Name textbox, enter
Countdown
.Select Number in the Type drop-down list.
Click on the OK button to close the dialog box.
In the left-hand panel, click on + Add Event.
Select Time, then Every N Seconds.
Rename the Every N Seconds event to
Decrement Countdown
.In the new do every … seconds event, enter the digit
1
into the empty textbox.Click on the Numbers & Text section button at the top of the instruction block palette.
Drag the increment number by 0 block into the do every...