I think that we should be able to assign tags to sprites for more efficient means of detection. This would be especially helpful in platformer games. For instance, the ground sprites. Here is what someone would normally use for their scripts (this is my personal style. idk about anyone else);
when gf clicked forever if <(touching? [sprite 1 v]) or <(touching? [sprite 2 v]) or <(touching? [sprite 3 v]) or (touching? [etc! ;b v])>>> //execute actions here endThat script always becomes a pest, and fairly large if you're making some huge platformer/scroller
add me to Tag [Ground v] delete me from Tag [Ground v]I think this would make this sort of programming very very efficient. Your script would look something like this after you've created and assigned your tag;
when gf clicked forever if (touching? [Tag: Ground v]) //execute actions hereSo, does any available mod have this feature or anything close to it? Thanks in advance!
Offline
If you make it then obviously yes. Otherwise no. I think.
Offline
That is a very cool and useful idea, but I don't think there is currently any mods with this feature. I am sure someone will make it.
Offline
Zparx wrote:
So, does any available mod have this feature or anything close to it?
In BYOB you can make a sprite-local variable TAGS in your first sprite with an empty list as its value, clone that one to make all your other sprites, and define "add me to tag (tag)" to be "add (tag) to (tags)."
Offline
bharvey wrote:
Zparx wrote:
So, does any available mod have this feature or anything close to it?
In BYOB you can make a sprite-local variable TAGS in your first sprite with an empty list as its value, clone that one to make all your other sprites, and define "add me to tag (tag)" to be "add (tag) to (tags)."
I'm kind of confused. Could you compose a project in BYOB of what you just said and email it to me? My email is: [email removed by moderator - please don't share contact information]
Last edited by Paddle2See (2012-10-20 05:35:14)
Offline
Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...
Offline
blob8108 wrote:
Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...
The "touching?" block does accept variable reporters, and I've actually tried that method, but its terrible. Since the variable constantly has to switch, all of the sprites in the list that your sprite is not touching at the moment, aren't detected until the variable loops back around, while your sprite is falling helplessly in the meantime..
Offline
Zparx wrote:
blob8108 wrote:
Does the "touching?" block accept variable reporters? Then you could iterate over a list, which could be a (kludgey) workaround...
The "touching?" block does accept variable reporters, and I've actually tried that method, but its terrible. Since the variable constantly has to switch, all of the sprites in the list that your sprite is not touching at the moment, aren't detected until the variable loops back around, while your sprite is falling helplessly in the meantime..
Ah, sure. The repeat loop makes it multiple frames. I should've thought of that...
The tags do sound like a nice idea, though
Offline
Zparx wrote:
Could you compose a project in BYOB of what you just said?
Here you go:
http://cs.berkeley.edu/~bh/tags.ypr
Click the green flag to make a bunch of sprites, each with a couple of tags.
Offline
I think I suggested this (or something like this) in Scratch Suggestions named 'Sprite Classes,' but it was declined as apparently the clone feature will let us do this.
Offline
northmeister wrote:
I think I suggested this (or something like this) in Scratch Suggestions named 'Sprite Classes,' but it was declined as apparently the clone feature will let us do this.
Here.
Offline