ุงู†ุชู‚ู„ ู„ู„ู…ุญุชูˆู‰
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: the race track

Section 2: MotionLesson 2.4 ยท โฑ 12 min

Robo is a racer on a track. You will make him pass set points in order until he reaches the finish line.

๐ŸŽฏ Project goal
Robo starts at the bottom left, glides to 4 points around the stage, then comes back to the start and says Finish!
The stage after running the program in Robo Block

Steps

  1. Draw the stage on paper, mark 4 points and write the x and y of each point.
  2. Start with go to the starting point.
  3. Add a glide for each point, in order.
  4. At the end, go back to the start and say Finish!
๐Ÿงฉ A possible solution
Blocks: when ๐Ÿšฉ clicked, go to x: (-180) y: (-120), glide (1) secs to x: (180) y: (-120), glide (1) secs to x: (180) y: (120), glide (1) secs to x: (-180) y: (120), glide (1) secs to x: (-180) y: (-120), say (Finish!) for (2) seconds
๐Ÿ“Œ Note
Notice that x changes when Robo moves right and left, and y changes when he moves up and down.

๐Ÿ“Œ Another example: a fast lap with Robo facing his way

After each side Robo turns a quarter turn to the left, so he always faces the direction of the track.

Blocks: when ๐Ÿšฉ clicked, go to x: (-180) y: (-120), point in direction (90), glide (0.5) secs to x: (180) y: (-120), turn โ†บ (90) degrees, glide (0.5) secs to x: (180) y: (120), turn โ†บ (90) degrees, glide (0.5) secs to x: (-180) y: (120), turn โ†บ (90) degrees, glide (0.5) secs to x: (-180) y: (-120), turn โ†บ (90) degrees, say (Fastest lap! ๐Ÿ) for (2) seconds
The first side
The first side
He turns and carries on
He turns and carries on
Lap finished
Lap finished
โœ๏ธ Practise
Draw your own track: choose 4 different points and build the race in the lab.
โœ๏ธ Practise here in the lessonor open the lab in a new page โ†—

๐ŸŽฏ Challenge yourself

Easy

Add a countdown 3, 2, 1 before Robo sets off, then he says โ€œI made it!โ€.

๐Ÿ‘€ Show the solution
Blocks: when ๐Ÿšฉ clicked, go to x: (-180) y: (-120), say (3) for (1) seconds, say (2) for (1) seconds, say (1) for (1) seconds, glide (1) secs to x: (180) y: (-120), say (I made it!) for (2) seconds
Arrived after the countdown
Arrived after the countdown
Medium

Change the shape of the track to the letter Z.

๐Ÿ‘€ Show the solution
Blocks: when ๐Ÿšฉ clicked, go to x: (-180) y: (120), glide (1) secs to x: (180) y: (120), glide (1) secs to x: (-180) y: (-120), glide (1) secs to x: (180) y: (-120)
Halfway along the track
Halfway along the track
Hard

Two laps: the first slow (0.8 seconds for each side), the second faster (0.4), then he says โ€œFinish! ๐Ÿ†โ€.

๐Ÿ‘€ Show the solution
Blocks: when ๐Ÿšฉ clicked, go to x: (-180) y: (-120), point in direction (90), glide (0.8) secs to x: (180) y: (-120), turn โ†บ (90) degrees, glide (0.8) secs to x: (180) y: (120), turn โ†บ (90) degrees, glide (0.8) secs to x: (-180) y: (120), turn โ†บ (90) degrees, glide (0.8) secs to x: (-180) y: (-120), turn โ†บ (90) degrees, glide (0.4) secs to x: (180) y: (-120), turn โ†บ (90) degrees, glide (0.4) secs to x: (180) y: (120), turn โ†บ (90) degrees, glide (0.4) secs to x: (-180) y: (120), turn โ†บ (90) degrees, glide (0.4) secs to x: (-180) y: (-120), turn โ†บ (90) degrees, say (Finish! ๐Ÿ†) for (2) seconds
Both laps finished
Both laps finished
Finished the lesson? Mark it so your progress counts.