Our Goal: A Standard Name Tag
For this very simple first code ever, we'll make a name tag similar to the standard name tag below. The colors and content are easy to recognize, everyone expects your name in the white space.
Coding
We will start with that green block already on screen. On Start
is a block in the Loops category of blocks. It doesn't loop though. It's purpose is to contain a series of other blocks when the board starts running our code which is what we want.
Background Color
The background we want is red, so we need a block that sets a red background. There is a block in the Scene block group (it has a blue tree next to it) called set background color to
which is exactly what we want.
Click the word "Scene" to open up a set of blue blocks. The view is like this:
The view above is zoomed in some. You'll see a lot of blocks under Scene. We want the third one, set background color to
. Using your mouse, left click and hold the mouse button on the block and drag it across the screen to the space inside the on start
block as shown above. Release the mouse button and the block should be placed as shown below.
Underneath the simulator, you could run this code but the background color is blank, not exactly what we want. We need to change the grey square in the set background color to
to red.
Left click that grey oval and select the color red. You should now see:
Page last edited March 08, 2024
Text editor powered by tinymce.