ุงู†ุชู‚ู„ ู„ู„ู…ุญุชูˆู‰
Robo EgyptRobo Egypt
โ˜ฐ Course contents
Robo Block: home
0. Lab tour1
1. Getting started5
2. Motion5
3. Looks and sound5
4. Events4
5. Loops5
6. Conditions and sensing4
7. Variables and randomness4
8. Project: the โ€œCatch Roboโ€ game3
9. Messages: characters talk to each other4
10. Clones: one character, many copies4
11. My Blocks: make a new block3
12. Operators and time4
13. The pro project: a jumping game4

๐Ÿ› ๏ธ Section project: hide and seek

Section 9: Messages: characters talk to each otherLesson 9.3 ยท โฑ 12 min
๐ŸŽฏ Project goal
A story with two characters and three messages: Robo greets the cat, she answers, then she hides, then she shows up and Robo finds her.
๐Ÿ“Œ Note
Add the cat: click โž• Character under the stage and choose โ€œCatโ€. Each character has its own blocks: click the character first, then snap its blocks.
๐Ÿงฉ ๐Ÿค– Robo: the start
Blocks: when ๐Ÿšฉ clicked, go to x: (-150) y: (-40), show, say (Hello, Cat!) for (2) seconds, broadcast (answer) and wait, say (Let's play hide and seek) for (2) seconds, broadcast (hide)
๐Ÿงฉ ๐Ÿค– Robo: when he receives โ€œfound youโ€
Blocks: when I receive (found you), glide (1) secs to x: (60) y: (-40), say (Found you! ๐ŸŽ‰) for (2) seconds
๐Ÿงฉ ๐Ÿฑ Cat: the start
Blocks: when ๐Ÿšฉ clicked, go to x: (150) y: (-40), show
๐Ÿงฉ ๐Ÿฑ Cat: when she receives โ€œanswerโ€
Blocks: when I receive (answer), say (Hi, Robo!) for (2) seconds
๐Ÿงฉ ๐Ÿฑ Cat: when she receives โ€œhideโ€
Blocks: when I receive (hide), hide, wait (2) seconds, show, broadcast (found you)
Scene 1: Robo invites the cat to play
Scene 1: Robo invites the cat to play
Scene 2: the cat has hidden
Scene 2: the cat has hidden
Scene 3: the cat shows up, and Robo finds her
Scene 3: the cat shows up, and Robo finds her
  1. Draw the story on paper: who speaks? And what happens next?
  2. Every โ€œnextโ€ = a message. Choose a name for it.
  3. Build Robo's blocks, then the cat's blocks.
  4. Run it and fix the order.

๐Ÿ“Œ Another example: the cat hides in a new place

Robo counts 1, 2, 3, then sends โ€œhideโ€. The cat hides, jumps to a random place, shows herself and sends โ€œhere I amโ€.

๐Ÿงฉ ๐Ÿค– Robo
Blocks: when ๐Ÿšฉ clicked, go to x: (-150) y: (-40), say (1), wait (0.6) seconds, say (2), wait (0.6) seconds, say (3), wait (0.6) seconds, broadcast (hide), say (Where are you? ๐Ÿ‘€)
๐Ÿงฉ ๐Ÿค– Robo
Blocks: when I receive (here I am), say (Found you! ๐ŸŽ‰) for (2) seconds
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when ๐Ÿšฉ clicked, go to x: (140) y: (-40), show
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when I receive (hide), hide, go to (random position), wait (1) seconds, show, broadcast (here I am)
Robo counts
Robo counts
The cat is hiding
The cat is hiding
He found her
He found her
โœ๏ธ Practise
Build the whole hide and seek here, and add a third character who plays with them.
โœ๏ธ Practise here in the lessonor open the lab in a new page โ†—

๐ŸŽฏ Challenge yourself

Easy

Robo closes his eyes and thinks โ€œ1... 2... 3...โ€, then says โ€œI'm coming to find you! ๐Ÿ”Žโ€.

๐Ÿ‘€ Show the solution
Blocks: when ๐Ÿšฉ clicked, go to x: (-150) y: (-40), think (1... 2... 3...) for (2) seconds, say (I'm coming to find you! ๐Ÿ”Ž) for (2) seconds
The result on the stage
The result on the stage
Medium

The cat hides and shows herself twice before she sends โ€œfound youโ€.

๐Ÿ‘€ Show the solution
๐Ÿงฉ ๐Ÿค– Robo
Blocks: when ๐Ÿšฉ clicked, go to x: (-150) y: (-40), broadcast (hide)
๐Ÿงฉ ๐Ÿค– Robo
Blocks: when I receive (found you), say (Found you! ๐ŸŽ‰) for (2) seconds
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when ๐Ÿšฉ clicked, go to x: (140) y: (-40), show
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when I receive (hide), repeat (2), broadcast (found you)
The result on the stage
The result on the stage
Hard

Three rounds: Robo repeats โ€œbroadcast and wait hideโ€ 3 times, counts the rounds in a variable found, then says he won.

๐Ÿ‘€ Show the solution
๐Ÿงฉ ๐Ÿค– Robo
Blocks: when ๐Ÿšฉ clicked, go to x: (-150) y: (-40), set (found) to (0), repeat (3), say (I won three rounds! ๐Ÿ†)
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when ๐Ÿšฉ clicked, go to x: (140) y: (-40)
๐Ÿงฉ ๐Ÿฑ Cat
Blocks: when I receive (hide), hide, wait (0.5) seconds, go to (random position), show
Three rounds
Three rounds
Finished the lesson? Mark it so your progress counts.