Let's code the robot to move on a specific path
In this activity, you will be making use of sound and display blocks to make the R2-D2 more interactive.
Activity
Do the setup as shown in Figure 8.117. R2-D2 is on a rescue mission for his master – Padme. R2-D2 needs to reach the computer system in under 5 seconds and turn it off by moving his head 180 degrees after reaching the spot. Once done, display Padme Saved! Mission Successful and play Hooray:
Figure 8.117 – Route setting
The sample code for this activity is given here:
Figure 8.118 - Sample code
Now, let's move on to a challenge.