This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-05 19:07:31

spuspu
Scratcher
Registered: 2011-02-10
Posts: 26

I receive sensor block

In scratch 2.0, I would appreciate it if there were an "I receive" block in "sensing."  I would like this because I need some of the scripts in my project to only happen until something is broadcasted.  Thanks for your concideration  smile

Offline

 

#2 2011-06-06 00:26:15

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: I receive sensor block

This has definitely been suggested before. A lot.  tongue  http://suggest.scratch.mit.edu/forums/6 … ?ref=title

It's a nice idea, but there are some kinks to work out. The biggest concern is that a broadcast is an event, not a boolean. In other words, a broadcast is broadcast and then disappears in an instant for hat blocks to receive, whereas booleans (the blocks with pointed ends) check for more "persistent" values. Some proposed solutions have been for the block to check for the last broadcast that was sent, or to check if the given broadcast had been sent within a given amount of time.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-06-06 12:50:19

Rexpup
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: I receive sensor block

Harakou wrote:

This has definitely been suggested before. A lot. :P http://suggest.scratch.mit.edu/forums/6 … ?ref=title

It's a nice idea, but there are some kinks to work out. The biggest concern is that a broadcast is an event, not a boolean. In other words, a broadcast is broadcast and then disappears in an instant for hat blocks to receive, whereas booleans (the blocks with pointed ends) check for more "persistent" values. Some proposed solutions have been for the block to check for the last broadcast that was sent, or to check if the given broadcast had been sent within a given amount of time.

Never thought about that before, but I think that this would best be made by:
When [>broadcast] recieved
[set [>variable] to (1)]

and

When green flag clicked
[if <(variable)=(1)>
{script here}
]

Last edited by Rexpup (2011-06-06 12:50:32)


http://i.imgur.com/QQH4J.gif

Offline

 

#4 2011-06-06 16:18:35

spuspu
Scratcher
Registered: 2011-02-10
Posts: 26

Re: I receive sensor block

Rexpup wrote:

Harakou wrote:

This has definitely been suggested before. A lot.  tongue  http://suggest.scratch.mit.edu/forums/6 … ?ref=title

It's a nice idea, but there are some kinks to work out. The biggest concern is that a broadcast is an event, not a boolean. In other words, a broadcast is broadcast and then disappears in an instant for hat blocks to receive, whereas booleans (the blocks with pointed ends) check for more "persistent" values. Some proposed solutions have been for the block to check for the last broadcast that was sent, or to check if the given broadcast had been sent within a given amount of time.

Never thought about that before, but I think that this would best be made by:
When [>broadcast] recieved
[set [>variable] to (1)]

and

When green flag clicked
[if <(variable) sad 1)>
{script here}
]

Haha, I thought of that like 5 seconds after I posted this, no joke.

Offline

 

Board footer