Wiki source code of Broadcast and wait [message]

Last modified by Stephan Robinig on 2020/12/07 22:40

Show last authors
1 (% class="box infomessage" %)
2 (((
3 Sends a specified message to all objects and the background. The object that sends the message waits until all objects, that received the message, have finished their scripts. Then the initial script continues.
4
5 [[image:brodcast_wait_brick3.png||alt="Broadcast and wait Brick"]]
6 )))
7
8 (% class="box" %)
9 (((
10 **Correlates with this brick:**
11
12 [[[[image:when-you-receive-__2.png||alt="When Your Receive Brick"]]>>doc:Documentation.BrickDocumentation.BroadcastReceiverBrick.WebHome]]
13 [[Learn more ~>~>>>doc:Documentation.BrickDocumentation.BroadcastReceiverBrick.WebHome]]
14 )))
15
16 (% class="row" %)
17 (((
18 (% class="col-xs-12 col-sm-6" %)
19 (((
20 (% class="box" %)
21 (((
22 ==== **Example** ====
23
24 Create two objects like:
25
26 [[image:brodcast_wait_example_1.png||alt="Broadcast and wait Example 1"]]
27
28 Tell the panda what to do when it receives the message:
29
30 [[image:brodcast_wait_example_2.png||alt="Broadcast and wait Example 2"]]
31
32 In game over take this script to specify when the message is sent and what to do when the other objects are finished with their scripts:
33
34 [[image:brodcast_wait_4.png||alt="Broadcast and wait Example 3"]]
35
36 **Note: select the same message in both bricks!**
37 )))
38 )))
39
40 (% class="col-xs-12 col-sm-6" %)
41 (((
42 (% class="box" %)
43 (((
44 ==== **Result** ====
45
46 [[[[image:null4.png||alt="Download"]]>>https://share.catrob.at/pocketcode/program/34644]]
47
48 [[image:broadcast-and-wait-__-3.gif||alt="Broadcast and wait Result"]]
49 )))
50 )))
51 )))