设置实例变量


描述

使用此函数你可以设置一个 内置的 变量所有物体的所有实例都有许多变量,以保存基本信息,如当前x / y位置,速度,方向,可见性和许多其他内容。你可以使用的实例变量如下所示

Once you select the built in variable to use, you then set the value for that variable. The value you use will depend on the variable selected (see the list above for defaults and ranges) and you can flag the value to be relative to the current value for the variable. You can also add additional variables to set in the same action by clicking the plus icon beside the action, and selecting another instance variable and giving it a value.


动作语法:

Set Instance Variable Syntax


参数:

参数 描述
变量 需要设置的内置变量
将变量设置为的值


例如:

Set Instance Variable Example

上述的代码将会取得之前的X/Y坐标值并将它们和当前X/Y值比较。. 如果它们不相同,那么将更改此实例的精灵索引,并将它的图像索引设为0.