From Test-Scratch-Wiki
- The correct title of this article is When () > () (block). The change of name is due to technical restrictions.
当 () 大于 () | |
Category | 事件类积木 |
Type | 半圆形积木 |
Introduced in | 2.0 |
When () > () 积木 is an 事件类积木 and a 半圆形积木. It starts the script below it when a value (chosen by the dropdown menu) is greater than another value (entered by the number input). The available options are 声音响度, 计时器, and 视讯动作.
值
声音响度
- Main article: 声音响度(值)
The loudness in the drop-down menu represents the volume of the sound that the computer microphone is picking up. The highest value is 100, and the lowest value is 1. Once the loudness is higher than the chosen amount, the script will begin to run.
计时器
- Main article: 计时器(值)
The timer 变量 is default on Scratch and constantly running, and it can be reset. It counts up from 0. Once the timer's value is greater than the chosen time, the script will run.
用法示例
This block can be used for many things, such as:
- Saying something when voice is entered
當 [聲音響度 v] > (10) 說出 [Be quiet!] (2) 秒
- Being motion activated
當 [視訊動作 v] > (10) 廣播訊息 [start v]
- Starting something after a delay
當 [計時器 v] > (10) 廣播訊息 [end game v]
应用
- Main article: List of Block Workarounds
Using a 等待直到 in conjunction with the 大于 or the 小于 blocks can create a workaround for this block.
重複無限次 等待直到 <(聲音響度) > (20)> . . . 等待直到 <<(聲音響度) > (20)> 不成立> end
Unceasing Timer Exploit
This event block has been occasionally used to create projects that can not be stopped. The following blocks can not be stopped by pressing the red stop sign once the project has started.
當 [計時器 v] > (0) 計時器重置 重複無限次 計時器重置 . . . end
This method can be used to simulate a When Stop Clicked block.