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

#1 2011-12-17 08:21:20

Clean0nion
Scratcher
Registered: 2011-02-22
Posts: 11

New Broadcast blocks

I'm not sure if this has been done before, but here is a suggestion for a new boolean block.

< received [   ] ?>

This is an idea for a Control block, in the broadcast category. If a broadcast, let's say "next level" has been received, the block becomes true. For example, when put into a "wait until":

|wait until < received [next level] ?> |

This would allow a player in a game to finish a level, and hide, then it waits until next level has been broadcasted, and shows.

Another boolean broadcast suggestion is as follows:

<times received [   ]>

If a sprite is waiting for next level to have been broadcasted twice, this could be used:

|wait until <<times received [next level]> = (2) >|

Thank you for reading this. If any clarifications are required, please ask.

Last edited by Clean0nion (2011-12-17 08:26:40)

Offline

 

#2 2011-12-17 08:36:40

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: New Broadcast blocks

i think it should be (most recent broadcast) because if you think about it,
<[] recieved> will only be true for 1 millisecond, and also having it as a reporter beans you can add it to a list or set a variable to it. Using this block, this script could be used to have a list that is updated every time a new broadcast is recieved.

When green flag clicked
forever
  set [recent broadcast v] to (most recent broadcast)
  add (recent broadcast) to [broadcast list v]
  wait until <not < (recent broadcast) = (most recent broadcast) > >
end forever

Then you can work out how many times a broadcast is on the broadcast list using a suitable script.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#3 2011-12-17 15:42:46

Clean0nion
Scratcher
Registered: 2011-02-22
Posts: 11

Re: New Broadcast blocks

joefarebrother wrote:

i think it should be (most recent broadcast) because if you think about it,
<[] recieved> will only be true for 1 millisecond, and also having it as a reporter beans you can add it to a list or set a variable to it. Using this block, this script could be used to have a list that is updated every time a new broadcast is recieved.

When green flag clicked
forever
  set [recent broadcast v] to (most recent broadcast)
  add (recent broadcast) to [broadcast list v]
  wait until <not < (recent broadcast) = (most recent broadcast) > >
end forever

Then you can work out how many times a broadcast is on the broadcast list using a suitable script.

True, but I meant < received [   ] ? > as in <Has this message been broadcasted?>

Offline

 

Board footer