How can I count sprites in project? Or may be it possible to ask ID of each sprite?
Replies
Karen Brennan
Member
October 01, 2009
I'm curious -- what are you trying to do in the project?
Rick Ashby
Member
October 01, 2009
Generating an ID for each Sprite is also possible but how you do it depends a lot on how you intend to use the IDs. I'll send a few examples this evening.
Rick Ashby
Member
October 01, 2009
Counting the sprites is a snap.
Create a "Counter" sprite to do the counting.
Add this script to it: when counter clicked-> broadcast "count sprites"
Then create a variable for for all all sprites called "Number of Sprites"
Then for each sprite that you wish to count, add this script: when I receive "count sprites"->change "Number of Sprites by 1.
You can modify that foundation to suite your needs.
I'm curious -- what are you trying to do in the project?
Generating an ID for each Sprite is also possible but how you do it depends a lot on how you intend to use the IDs. I'll send a few examples this evening.
Counting the sprites is a snap.
You can modify that foundation to suite your needs.