Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

2. Stampa il tuo modello

Transcript

In this video, you'll learn how to use the “Print Prepare” procedure in your starter project to print a pattern. Using the Print Prepare procedure moves the sprite a specified distance. When the sprite reaches the edge of the stage, it starts again one 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 procedure at a specific point in your code.

Go to the "more blocks" menu, drag out the "Print Prepare" block, and place it inside the "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 moves horizontally and vertically. To run the code, press the “1” key. The sprite moves across and up the stage. However, it doesn’t create a pattern. That's because the 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 under the “print prepare” block. Press the “1” key, and the sprite will move 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 second time. That's okay. In the next video, you'll learn how to create a procedure to reset the stage, allowing the user to reprint the pattern. Now, it's your turn! Click on the more blocks menu, 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 code print a set of stamps once. Then, move on to the next video to learn how to make the pattern print multiple times.

arrow_backward Indietro
Avanti arrow_forward
Istruzioni
  1. Utilizzare la procedura di preparazione dei file di stampa.
  2. Programma il modello da stampare.