Eng:Change () by () (block)

The Change by  block is a Variables block and a Stack block. The block will change the specified variable by a given amount. If the variable is a string and not a number, it is set to the quantity the variable was to be changed by (casting 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.



Example Uses
Some common uses for the Change by  block: set [speed v] to (2) set x to (-240) forever change x by (speed) change [speed v] by (1) say [Whee!!!] if (touching [goal v]?) then change [level v] by (1) end if (touching [laser v]?) then change [score v] by (-5) end
 * Changing the speed of an object
 * Changing a level number
 * Changing the score in a game

Workaround
This block can be replaced by the following script:

set [variable v] to ((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.