Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
Hey. My name is Kamar,
and I'm gonna tell you about
the draw an alternating pattern add-on.
In this add-on, you will draw and program
two shapes to create an alternating pattern.
To start, draw two new costumes
for the pattern maker sprite.
This example would demonstrate how to use
the line, ellipse, and fill tools to make patterns,
but you can draw your own pattern however you like.
Select the pattern maker sprite and the costumes tab.
Click paint new costume.
To create the first pattern,
select the line tool and a color.
Then, draw a series of overlapping lines.
Use the field tool to color this pattern.
If you do something that you don't like,
Just click the undo tool.
Once you've finished this pattern, center it.
Then, rename the costume.
This example names it line pattern.
Click the paint new costume button
to create the second pattern,
using the ellipse and fill tools.
Similar to the line pattern, draw a series of ellipsis
and use the fill tool to color them.
The two patterns that you draw will be used together,
so make sure you select colors for the ellipsis
that work well with the line pattern.
Center this pattern.
Then, rename that costume.
This example names it circle pattern.
Next, program these two new costumes
to alternate to create a new pattern.
Duplicate a when key press event block stack
and select a new key to start this code.
This example will use space.
Select one of the new patters in the switch costume block,
then press the select a key to run it.
To see how the second pattern looks,
select the other costume in the switch costume block
and run it.
To alternate between costumes,
switch costumes in the repeat until block.
Drag the switch costume block into the loop.
When this code runs, the costume switches
to the circle, then the print prepare block
creates the spacing and size for the pattern.
Then, the sprite stamps.
Press the selected key to try it.
Great, it still works.
Right click the switch costume block
to duplicate this code stack,
and place this new stack in the repeat until loop.
Select the other pattern in the switch costume block.
Press the key.
Both patterns show.
Tinker with the values in the print prepare block
to see different spacing and sizing looks.
To find out what a value does,
look at the define block.
For example, the first value in the block
controls the horizontal spacing.
Once you've programmed an alternating pattern,
experiment with drawing different shapes,
patterns, and colors, to create new costumes.
You can even try to use the vector editor
to make alternating shapes that look like camouflage.
Now it's your turn.
Draw two new costumes for the pattern maker sprite.
Duplicate a when key press block stack
and change the value to a different key press.
Add the switch costume block to the repeat loop
and duplicate the inner block stack.
Change the costume values to the two new patterns.
And finally, tinker with the values
in the print prepare block to see
how different sizing and spacing affects the pattern's look.