Raspberry_Pi_Education_Manual

Notes:

Robot project

Resources: The sprite “ robot_control ” and the background “ robot_maze ”.

Tip...

We have included the code of a more complete version of the robot program, “Robot_2” (see the screenshot above). In this version, the robot can be moved up, down, left and right. Task: Now it’s your turn to do some programming. Program the robot and then use your program to make the robot follow the yellow path on the “ robot_maze ” background. Task: Load the code and then change it to make the robot walk more quickly.

This is useful code for

controlling characters in games.

For an example of this script in action, open RPiScratch/Projects/robot_v2.

A beginner’s guide to Scratch

37

Made with FlippingBook flipbook maker