What You Will Build
Build a generative art tool that draws flowers using the Pen extension and rotational 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 stamp petal shapes in a circular arrangement
- Use repeat loops with rotation maths to create symmetrical flowers
- Control petal count and size with slider variables
- Generate a field of flowers at random positions
- Add a clear button and seasonal themes
Step-by-Step Guide
- 1Enable the Pen extension. Create a small oval petal sprite.
- 2On start: pen down, set pen colour, go to x:0, y:0.
- 3Add a repeat (petals) loop. Inside: stamp the petal, turn (360/petals) degrees.
- 4Add change pen colour by 10 to cycle rainbow colours per loop.
- 5After one flower: go to a new random position and repeat.
- 6Create a petals slider (right-click variable → slider). Range 4–16.
- 7Create a size slider. Use set size to (size) before stamping.
- 8Add a Clear button: clear all pen stamps, return to centre.
- 9Add a Season button: Spring (small pastel flowers), Summer (large bright sunflowers).
- 10Add an animation mode: draw one flower at a time with a short pause between.
Extension Challenges
Finished the main project? Push further:
- Add stems using the Pen to draw a line beneath each flower.
- Add a wind effect: make flowers tilt using a random rotation each time.
- Share the generated artwork by taking a screenshot or exporting the stage.