What if a sprite has some costumes, and there is a costume named 1? It's not possible now since Scratch would rename it to "11" or something, but what do you think would happen if I said for a sprite to go to costume 1? Would it go to costume #1 or the costume named 1?
For those of you wondering, the "change to costume/background []" block accepts a number and word.
Last edited by ihaveamac (2011-05-19 22:35:42)
Offline
I will check the code. It depends on which it would try first.
Offline
Couldn't find out, its in ScriptableScratchMorph costumeIndex:.
Offline
Harakou wrote:
I don't know; maybe you should try it out and see?
![]()
Read the post, it's not possible now.
Sidharth wrote:
ihaveamac wrote:
Would it go to costume #1 or the costume named 1?
It would go to costume 1, I believe.
(Atleast that is my guess)
Can you be more specific?
Offline
If you tell a sprite to set its costume to a variable set to "1" it goes to the first costume.
However, if you have eleven costumes, one of which is called "11," and tell it to set the costume to a variable set to "11" it goes to the costume labeled "11" instead of the eleventh costume.
So basically if you tell it to go to a number, if that number is a label it will go to the labeled costume, but if that number is not a label it will instead go to the numbered costume.
Final Verdict: Name of costume has priority over number of costume.
Does that answer your question?
Last edited by Kileymeister (2011-05-20 16:00:46)
Offline
ihaveamac wrote:
Harakou wrote:
I don't know; maybe you should try it out and see?
![]()
Read the post, it's not possible now.
Can you be more specific?
Oh, I see. Sorry, I was tired and sort of skimmed that, and didn't catch that part.
Offline