The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 4 Programming with Scratch^81

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


For Olympic-style synchronised swimming, though, we need more swimmers, and we
need a way to reset the cat sprite’s position. Add a when clicked Events block, then
underneath add a go to x: 0 y: 0 Motion block – changing the values if necessary – and a
point in direction 90 Looks block. Now, when you click the green flag, the cat will be moved
to the middle of the stage and pointing to the right.


when left arrow key pressed


switch costume to left


turn^15 degrees


when right arrow key pressed


switch costume to right


turn^15 degrees


when up arrow key pressed


move^10 steps


when down arrow key pressed


move -10 steps


when clicked


goto x:^0 y:^0


point indirection^90

Free download pdf