In this video, you'll learn how to use the “Print Prepare” procedure in your starterproject to print a pattern. Using the Print Prepare procedure moves thesprite a specified distance. When the sprite reaches the edge of the stage, it starts againone row up, at the left side of the stage. To use the procedure, you’ll need to “call”it. That means you tell the computer to follow the list of tasks contained in that one procedureat a specific point in your code.
Go to the "more blocks" menu, drag out the "Print Prepare" block, and place it insidethe "repeat until" loop that was included in your starter project. Enter the number"40" in each of the two value spaces. These numbers set the distance the sprite moveshorizontally and vertically. To run the code, press the “1” key. Thesprite moves across and up the stage. However, it doesn’t create a pattern. That's becausethe procedure moves the sprite; it doesn’t make it stamp.
To stamp the sprite, go to the "pen" menu, drag out the "stamp" block, and place it underthe “print prepare” block. Press the “1” key, and the sprite willmove across the screen and print a copy of itself as it travels.
Awesome! But the pattern only prints once. Nothing happens if you press the 1 key a secondtime. That's okay. In the next video, you'll learn how to create a procedure to reset thestage, allowing the user to reprint the pattern. Now, it's your turn! Click on the more blocksmenu, and drag the "print prepare" block into the "repeat until" loop. Select the "pen"menu, and add a "stamp" block under the "print prepare" procedure. Press 1 to see the codeprint a set of stamps once. Then, move on to the next video to learn how to make thepattern print multiple times.