This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Suggestions
  •  » Two new layer blocks - one for Sensing and one for Looks

#1 2009-12-16 03:29:21

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Two new layer blocks - one for Sensing and one for Looks

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:
http://www.imagebeast.net/images/nu8bnoukxnxyeypi0dvz.png
http://www.imagebeast.net/images/guf2vyfz3o56wi4v5g0v.png

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:
http://www.imagebeast.net/images/fs4bv408udfcumzb15ws.png
http://www.imagebeast.net/images/emd6d7finrt44hndjlk.png

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.  smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#2 2009-12-16 11:07:46

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

I want it. And support, remember, I have the same problems as you when making an OS with or without drag-gable windows.


Hai.

Offline

 

#3 2009-12-16 23:10:17

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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.  wink


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#4 2009-12-17 03:22:12

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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...


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2009-12-17 03:26:45

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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).  sad


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#6 2009-12-17 03:48:11

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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]
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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#7 2009-12-17 23:36:12

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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]
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.

Oops... silly me. Of course that won't work.  tongue

Let's change that = to a >.  smile
..........................................
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?


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#8 2009-12-20 15:12:54

piggygreen
Scratcher
Registered: 2009-11-24
Posts: 2

Re: Two new layer blocks - one for Sensing and one for Looks

I think it would be more easy to use for new users.
What does this mean?.....<change{  }by(

Offline

 

#9 2009-12-21 00:49:34

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

Yes, I support your idea.


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#10 2009-12-21 00:50:34

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

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?  mad


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#11 2009-12-22 00:27:17

martianshark
Scratcher
Registered: 2008-03-24
Posts: 1000+

Re: Two new layer blocks - one for Sensing and one for Looks

I agree! Working with layers would be so much easier with this block!


http://img.geocaching.com/stats/img.aspx?txt=martianshark&amp;uid=e6cdc2c8-2476-4abd-9994-27f857396579&amp;bg=1

Offline

 
  • Index
  •  » Suggestions
  •  » Two new layer blocks - one for Sensing and one for Looks

Board footer