Counting Sprites
Материал из Поле цифровой дидактики
If you have a lot of clones with a local variable, they may want to count them automatically, rather than individually assigning each of them a number in a set () to () block. With this method, a script could specifically call the number-seven clone without hard-coding it.
Method
Firstly, a global variable should be created. Then, on the stage, the following script should be added:
Now, for all the sprites that want to be counted (and generally these will be clones of the same sprite), this script should be added:
Then, when the flag is clicked, each sprite will obtain a unique number in .
This works because of the execution order of broadcasts.