Professional Documents
Culture Documents
ART SPIRALIZER
Spiralizer
Try out this spinning spiral project. Click the icon to The clones’ different The ball in the centre
Change the patterns using special make the spiral
fill your screen.
directions make is the original sprite;
them form a spiral. all the others are clones.
sliders to alter the values of variables
in the code. You control the art – the
Spiralizer
possibilities are endless! by SpiralAttack (unshared)
Angle 10
△ Clones
How it works Speed 2
Clones are working copies
This simple project has only one sprite: a of sprites. When a clone is
coloured ball, which stays in the middle. created, it appears on top
of the existing sprite and
Scratch’s clone blocks make copies of the has the same properties,
ball that move outwards in straight lines. such as direction, size,
A spiral pattern forms because each clone and so on.
moves in a slightly different direction, like
water from a garden sprinkler. The Scratch
pen draws a trail behind each clone, making
colourful background patterns.
1
Project 7
ART SPIRALIZER
2
when I start as a clone the edge of the stage?
3
Add this loop to make clones of the ball. To make the clones move, add this second script to
When you run this script nothing much will the ball sprite. Every new clone will now run its own Add this “if
forever
appear to happen. Actually, it’s making lots copy of this script when it appears. The script makes then” block
of clones of the ball sprite, but they’re all on the clone move away from the centre in the direction inside the loop.
move 2 steps
top of each other. You can drag them apart the parent sprite was pointing when it was cloned.
with the mouse (but only in editor mode, Run the project.
not full-screen mode). if touching edge ▾ ? then
2
Project 7
ART SPIRALIZER
Angle 10
The variables are shown Angle 10
on the stage like this. normal readout
Speed
Move the two sliders
large readout slightly apart on the
stage so that you can
slider see them fully.
Speed 2
hide
Angle
Use the mouse to adjust
the value of this variable.
Speed
12 Now try experimenting
with different values.
3
Project 7
ART SPIRALIZER
everything from the parent sprite the moment each one draws in a new colour. Speed 2
they’re created, such as size, direction, colour, set Angle ▾ to 7
costume, and so on). Add these green blocks
to activate the pen for every clone. set Speed ▾ to 2
when clicked
set size to 30 %
This block removes set Angle ▾ to 10
all pen trails so the go to x: 0 y: 0
stage starts blank. set Speed ▾ to 2
forever set size to 30 %
clear
This activates create clone of myself ▾
the pen so go to x: 0 y: 0
set pen size to 1
that every
turn Angle degrees clear
clone leaves
pen down Type 1 in here
a trail.
for a thin pen. set pen size to 1
pen down
Speed 2 Speed 2
4
Project 7
ART SPIRALIZER
Angle 10 Angle 10
change pen colour by 1
Speed 2 Speed 2
5
Project 7
ART SPIRALIZER
when you press the down arrow key and the stage and then hit the space-bar to clear the
bring them back with the up arrow key. You old pattern. See if you can create the artificial sunset
can save the picture as an image file on your pattern shown here. Hint: you’ll need a pen size of 1
computer by right-clicking on the stage. and the “Angle” variable set to 7. Don’t forget there’s
a “go to” block in the code that will reset the position
each time the project is run – you can take that block
out or change the coordinates once you’ve found
when down arrow ▾ key pressed a good sun position. You could even add another
This block full-sized ball sprite in yellow to be the sun.
hide
hides all Spiralizer
by SpiralAttack (unshared)
the clones.
hide variable Angle ▾
These hide
the sliders.
TRY THIS
Spiralizer
◁ Ball control when clicked when I start as a clone
by SpiralAttack (unshared) Instead of generating clones in a spiral pattern, you repeat 10 point in direction pick random –180 to 180
Angle 10 can make them follow the mouse-pointer. Just replace
the “turn” block with a “point towards mouse-pointer” create clone of myself ▾ forever
Speed 2 block. Now try painting with the mouse. change colour ▾ effect by 25 move 10 steps
if on edge, bounce
Clones shoot out from
the centre towards the
mouse-pointer.