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 here
Zparx wrote:
In BYOB, I've actually put this script together but without tags. I edited a true/false sensing block, like this:
when gf clicked forever if <(touching [sprite 1 v]?) or (touching [sprite 2 v]?)> report true else report falseAnd called the block "touching ground sprites?"
and it worked like a charm! I added 5 new sprites to the created block and it still worked flawlessly. So I doubt it will be hard to implement if BYOB has already (sort of) done it!
Let me know what you think!
--------------------
SUPPORTERS
-------------------
* Firedrake969
* Mokat
* 777w
* taddl
* dvd4
* ErnieParke
* subzerostig
* technoboy10
* Martiscratch
* Rexpup
* Willpower
* nitromian
* TorbyFork234
* scratchisthebest
Last edited by Zparx (2012-11-08 00:14:26)
Offline
interesting idea
Offline
Mega support.
Offline
Duplicate. Reporting to be closed.
EDIT: Oh, and this
Last edited by Firedrake969 (2012-10-19 21:51:12)
Offline
Firedrake969 wrote:
Duplicate. Reporting to be closed.
Organization and tagging are two completely different things. I don't think you fully understand my suggestion.
Offline
Firedrake969 wrote:
Duplicate. Reporting to be closed.
EDIT: Oh, and this
That's different...
Offline
Mokat wrote:
Firedrake969 wrote:
Duplicate. Reporting to be closed.
EDIT: Oh, and thisThat's different...
Thank you..
Offline
This can really help in quite a few situations and I don't think that it'll be confusing for children, so I support.
Offline
Definitely support. For some projects I have to resort to 'touching colour?' Instead of touching sprite a - b
Offline
A proof of it's usefulness:
when gf clicked forever if <(touching? [sprite 1 v]) or <(touching? [sprite 2 v]) or <(touching? [sprite 3 v]) or <(touching? [sprite 4 v]) or <(touching? [sprite 5 v]) or (touching? [sprite 6 v])>>>>> //execute actions here enddoes this look simple ?
Last edited by dvd4 (2012-10-20 19:50:15)
Offline
dvd4 wrote:
A proof of it's usefulness:
when gf clicked forever if <(touching? [sprite 1 v]) or <(touching? [sprite 2 v]) or <(touching? [sprite 3 v]) or <(touching? [sprite 4 v]) or <(touching? [sprite 5 v]) or (touching? [sprite 6 v])>>>>> //execute actions here enddoes this look simple ?
exactly (:
Offline
Once, I worked for half an hour doing that, then realized that it didn't work and I deleted that script....
Offline
Firedrake969 wrote:
Once, I worked for half an hour doing that, then realized that it didn't work and I deleted that script....
Which script?
Offline
I think you may have suggested this before...
Offline
northmeister wrote:
I think you may have suggested this before...
![]()
I did, but everyone mistook it for "organizing" and putting the sprites in "folders" when that's not what I'm suggesting. I decided to reword some things so that hopefully people understand more clearly.
Offline
Support. This would be cool.
Offline
I support, but in the meantime you can use this relatively long workaround:
Make a list with a name of Tags:(TagName)
Then, for every sprite you have that you would want to be under that tag, you would put a
add [spritename] to [Tags:TagName v]then, for sensing, you would do this:
when I receive [touching tagName v] //has to be under the sprite that you want to be checked for touching set [i v] to [1] set [touching v] to [0] repeat <length of [Tags:TagName v]> if <touching <item (i) of [Tags:TagName v]>?> set [touching v] to [1] end change [i v] by (1) end if <(touching)=[1]> say [you touched one of the sprites with a tag of tag name!] endAlternatively, for that script, since it's only for sensing, if you want to make it go faster, you could change the repeat to this:
repeat until <<((i)+(1))=<length of [Tags:TagName v]>>or<(touching)=[1]>> endYou could also just have the bunch of or's sitting at the edge of the screen, and when you need it just duplicate it.
Offline
TorbyFork234 wrote:
I support, but in the meantime you can use this relatively long workaround:
Make a list with a name of Tags:(TagName)
Then, for every sprite you have that you would want to be under that tag, you would put aadd [spritename] to [Tags:TagName v]then, for sensing, you would do this:when I receive [touching tagName v] //has to be under the sprite that you want to be checked for touching set [i v] to [1] set [touching v] to [0] repeat <length of [Tags:TagName v]> if <touching <item (i) of [Tags:TagName v]>?> set [touching v] to [1] end change [i v] by (1) end if <(touching)=[1]> say [you touched one of the sprites with a tag of tag name!] endAlternatively, for that script, since it's only for sensing, if you want to make it go faster, you could change the repeat to this:repeat until <<((i)+(1))=<length of [Tags:TagName v]>>or<(touching)=[1]>> endYou could also just have the bunch of or's sitting at the edge of the screen, and when you need it just duplicate it.
Anyways, it would be better to have it built in.
This is an effective method, and I've used it in some of my big games, such as "Cyber Defense" in which I added 10 sprites to the list. It worked fine because the turrets didn't require quick touch sense detection. However, if I had 10 or more ground sprites added to a list for a platformer and used this method, it would be very ineffective unless I used turbo mode.
Last edited by Zparx (2012-10-22 22:25:09)
Offline