In this video, you will create a sprite that stamps each pixel either white or black. Todo this, you will learn about the starter code, add a “stamp” block, and add a “nextcostume” block to the project.
In order to change each pixel, the scanner sprite needs to check every spot on the screen.
The starter code is programmed with two repeat loops. One loop moves the scanner sprite fromleft to right. This loop is located within the loop that moves it from top to bottom.
This code makes sure the scanner sprite touches every spot on the screen, just like readinga paragraph in a book -- start from the left, finish the line, and go to the next line,until the page is finished.
If you press the green flag, you will see a little white dot move across the top ofthe screen and travel down to the bottom. In order to speed up the process, click editand select “turbo mode.” With the program in turbo mode, you may not see the scannersprite move because it moves so quickly. To begin changing the color of each pixel,you will need to make the scanner sprite stamp itself while it travels across the stage.
Start by placing the “stamp” block within the second repeat loop, after the “changex by 3” block. This allows the scanner sprite program to stamp itself both across and down.
Click on the green flag to test the project. It works! The scanner sprite is a white dotthat stamps itself and makes the whole screen white.
If you can make the entire screen white, then you can also make it any other color -- it onlydepends on the color of the scanner sprite’s costume. In the next video, you will use aconditional statement to make the scanner sprite stamp either white OR black.
Now, it’s your turn. Go to the edit menu, and select turbo mode to speed up the scannersprite. Make the background white by adding a “stamp” block.