You may think this isn't neccessary, and maybe you're right.
I think it is, so you can yell at me if I'm silly.
The sensing block:
I was making an OS and was up to the point of making some windows. However, the sensing was a bit irritating - the <touching [mouse-pointer]> block has an effect even if the sprite is covered by a sprite with a higher layer.
So, I was going to have it sense if its layer was greater. The problem was: No layer block.
I can easily visualize how it works. Some examples:
if <(layer) > ([layer] of [sprite1]) >
broadcast [go to back]
endif
forever
set [layer] to ([layer] of [sprite1])
endforever
....................................
The looks block:
Handy for stuff such as:
forever
if (layer) > ([layer] of [sprite1])
set [change] to 0
endif
endforever
if (layer) = ([layer] of [sprite1])
broadcast [free]
endif
Those two blocks would work well together.
....................................
Please share your opinion.
Offline
fg123 wrote:
I want it. And support, remember, I have the same problems as you when making an OS with or without drag-gable windows.
I thought so.
Offline
How would it work. Scratch currently only has a "Go to front" block and a "Go back n layers" block. Would it count the layers from the high to low or otherwise?
And they usually don't add new blocks because each block makes Scratch harder to learn.First, think of how many times you'd need the layer block. Frequently, I'm sure (since I would use it frequently myself) And you should check if it can't be done already with a local layer variable...
Offline
JSO wrote:
How would it work. Scratch currently only has a "Go to front" block and a "Go back n layers" block. Would it count the layers from the high to low or otherwise?
It keeps track of what layer the sprite is in.
JSO wrote:
And they usually don't add new blocks because each block makes Scratch harder to learn.First, think of how many times you'd need the layer block. Frequently, I'm sure (since I would use it frequently myself) And you should check if it can't be done already with a local layer variable...
You can't use a variable, because you'd need to set the variable to (layer).
Offline
I like the idea...it would make working with layers much easier.
However, in your example of a possible use:
if (layer) = ([layer] of [sprite1]) broadcast [free] endif
I don't think you would ever get a match since I don't believe that two sprites ever have the same layer number. My understanding is that the number of layers increases with each new sprite and that the layer numbers are unique for each sprite. They are simply an ordering of the sprites.
However, that minor quibble doesn't take away any of the appeal of the suggestion...in fact it would make it easy to verify if my theory is correct.
Offline
Paddle2See wrote:
I like the idea...it would make working with layers much easier.
However, in your example of a possible use:Code:
if (layer) = ([layer] of [sprite1]) broadcast [free] endifI don't think you would ever get a match since I don't believe that two sprites ever have the same layer number. My understanding is that the number of layers increases with each new sprite and that the layer numbers are unique for each sprite. They are simply an ordering of the sprites.
However, that minor quibble doesn't take away any of the appeal of the suggestion...in fact it would make it easy to verify if my theory is correct.
Oops... silly me. Of course that won't work.
Let's change that = to a >.
..........................................
As for the block, what's the overall opinion? I like it because I can easily imagine how it works... but that's my opinion.
What does everyone think?
Offline
I think it would be more easy to use for new users.
What does this mean?.....<change{ }by(
Offline
Yes, I support your idea.
Offline
JSO wrote:
And they usually don't add new blocks because each block makes Scratch harder to learn.
If you say that, then why don't you say that to all the topics in Suggestions asking for new blocks?
Offline
I agree! Working with layers would be so much easier with this block!
Offline