What You Will Build
Create beautiful symmetrical mandala artwork using the Pen extension and mathematical loops. Follow the guide below to build the project, then open the official Raspberry Pi page for starter files, worked examples and extra help.
🍓 This project is on the Raspberry Pi Foundation website. Click the orange button above to access the full guide, starter Scratch project and extension activities on projects.raspberrypi.org.
What You Will Learn
- Use the Pen extension to draw on the stage canvas
- Use repeat loops with rotation to create radial symmetry
- Change pen colour per iteration to create rainbow patterns
- Use variables as sliders to control petal count and size
- Clear and redraw using a reset button
Step-by-Step Guide
- 1Enable the Pen extension from the Extensions menu.
- 2Create a small petal sprite (an oval or leaf shape) at the centre x:0, y:0.
- 3Under when 🏳️ clicked: pen down, set pen size to 2.
- 4Add a repeat [petals] loop (petals variable set to 12).
- 5Inside the loop: move 50 steps → stamp → move -50 steps → turn 30 degrees (360 / petals).
- 6Add change pen color by 10 inside the loop for a rainbow effect.
- 7Add a second outer loop for layered rings at different distances.
- 8Create a petals slider variable using the variable's right-click → slider option.
- 9Add a Reset button sprite: clear then re-run the drawing script.
- 10Experiment with different petal shapes, sizes and step distances.
Extension Challenges
Finished the main project? Push further:
- Add a size slider variable so the user can change how big each petal is.
- Create an animation mode where the mandala draws itself gradually one petal at a time.
- Try drawing with a triangle or star shape instead of an oval petal.