Another pair of sensing code blocks that you need to become familiar with is shown in Figure 6.11. These code blocks provide the ability to enable and work with Scratch’s built-in timer.
The first code block resets the timer back to its default value of zero, and the second code block retrieves a number specifying how many seconds have passed since the timer started running. Using Scratch’s timer, you can control the pace of animation and the operation of your Scratch applications. For example, you would need to use these controls to keep track of time when players are given a certain amount of time in which to make a move.
The following example demonstrates how to use both of these timer code blocks to create a script that repeatedly plays an audio file for five seconds.
3.142.12.207