The game file to import and load for this session is 5961_06_07.stencyl
.
10
.10
.10
.We have created a timer bar that displays the amount of time remaining for the player to collect the fruit, and the timer bar reduces in size with the countdown!
First, in the Display HUD event we deactivated, or disabled, the block that was drawing the textual countdown message, because we no longer want the text message to be displayed on the screen.
The next step was to insert a draw rect …
block that was configured to create a filled rectangle at the upper-left corner of the screen and with a width equal to the value of the Countdown
timer multiplied by 10
. If we had not multiplied the value of the countdown by 10, the timer bar would be very small and difficult to see (try it)!
We'll be making some improvements to the timer bar later in this chapter.
When we deactivate an instruction block, as we did in the Display HUD event, it no longer functions; it's completely ignored! However, the block remains in place, but is shown slightly faded, and if required, it can easily be reenabled by right-clicking on it and selecting the Activate / Deactivate option.
Being able to activate and deactivate instruction blocks without deleting them is a useful feature — it enables us to try out new instructions, such as our timer bar, without having to completely remove blocks that we might want to use in the future. If, for example, we decided that we didn't want to use the timer bar, we could deactivate it and reactivate the draw text …
block!
The game file to import and load for this session is 5961_06_08.stencyl
.
Referring to Stencyl's online help if required at www.stencyl.com/help/, try to make the following improvements to the timer bar:
Ask an independent tester for feedback about the changes and then modify the timer bar based on the feedback.
18.117.158.165