Discuss Scratch
- Discussion Forums
- » Suggestions
- » Suggestion - Instance Variables
- k8animation
-
5 posts
Suggestion - Instance Variables
Could it be possible to add a feature that creates a new variable for a clone of a sprite? This variable would have to be created when a clone is created and have a specific ID? This variable would be deleted at the same time as the clone it would be connected to was deleted. This would make games with multiple NPC's easier to create and manage
- beckerb4
-
12 posts
Suggestion - Instance Variables
I agree that there needs to be a way to reference sprites after they have been created. Not sure of the best way to do it though.
Either they need a name, or we need the ability to add sprites to lists.
Either they need a name, or we need the ability to add sprites to lists.
- k8animation
-
5 posts
Suggestion - Instance Variables
yeah I agree that there needs to be a way to reference sprites after they have been created. Not sure of the best way to do it though.
Either they need a name, or we need the ability to add sprites to lists.
- Hardmath123
-
1000+ posts
Suggestion - Instance Variables
Use the “for this sprite only” option.
- k8animation
-
5 posts
Suggestion - Instance Variables
that will effect the sprite and all of its clones… i'm looking for something that makes individual variables for each clone, hence the term instance variables Use the “for this sprite only” option.
- blob8108
-
1000+ posts
Suggestion - Instance Variables
Hardmath has a point — each clone already gets its own copy of the sprite's variables. What can't you do with the way it works currently?
- k8animation
-
5 posts
Suggestion - Instance Variables
I was unaware of that, and im not completely sure how to do that Hardmath has a point — each clone already gets its own copy of the sprite's variables. What can't you do with the way it works currently?
- lalala3
-
100+ posts
Suggestion - Instance Variables
1. Add a global variable. Set it to 0.I was unaware of that, and im not completely sure how to do that Hardmath has a point — each clone already gets its own copy of the sprite's variables. What can't you do with the way it works currently?
2. When you make a new clone, have it assign its ID variable to the global variable, and then increment the global variable.
Done.
Last edited by lalala3 (Feb. 25, 2013 23:33:17)
- Discussion Forums
- » Suggestions
-
» Suggestion - Instance Variables