And the thing I wanted point out is, we've got this global variable number of calls. Which is there not because Fibonacci needs it but just for pedagogical reasons, so that we can keep track of how much work this thing is doing.
要指出的是我们已经,调用了几次这个全局变量,这不是因为斐波那契数列,需要调用它而只是,因为教学上的需要,以便我们可以知道,这个函数做了多少事情。
So I start this program by declaring as I did before a global variable X. It is global simply because it is not inside any of my functions.
在程序的开始,我声明,一个全局变量X,它是一个全局的,因为它不在任何一个函数里面。
For this sprite only, means local, only this function, only this script can use this variable, make this variable for all sprites, meant it was global.
对于只为一种精灵,意思是局部的,只有这个函数中,这个脚本中才可以用这个变量,这个变量为全部精灵而创建,意思是这个变量是全局的。
应用推荐