Zho:变数 () 改变 ()（积木）

The Change by  积木 is a 变量类积木 and a 条形积木. The block will change the specified 变量 by a given amount. If the variable is a 字串 and not a number, it is set to the quantity the variable was to be changed by (转换 the string to 0).

Prior to Scratch 1.3, this block did not have a drop-down input listing the variables and instead there was an instance of it for each variable.



用法示例
Some common uses for the Change by  block: 變數 [speed v] 設為 (2) x 設為 (-240) 重複無限次 x 改變 (speed) 變數 [speed v] 改變 (1) 說出 [Whee!!!] end 如果 <碰到 [goal v] ?> 那麼 變數 [level v] 改變 (1) end 如果 <碰到 [laser v] ?> 那麼 變數 [score v] 改變 (-5) end
 * Changing the speed of an object
 * Changing a level number
 * Changing the score in a game

应用
This block can be replaced by the following script:

變數 [variable v] 設為 ((variable) + (amount))

The blank space at the far right contains the number that will change the valuea positive number to increase and a negative number to decrease the variable.

参见

 * 变数 设为