Fun Scratch Painting App Tutorial for Kids: Pen extension

Block Programming

Scratch Painting App Tutorial: Create Color Palettes, Brush Sizes & Eraser Tool

Are you looking for a fun way to introduce your child to the world of Scratch programming? Want to help them build something creative while learning block programming? Then you're in the right place! This Scratch painting app tutorial teaches interactive design with variables.

In this tutorial, we'll walk you through creating a painting app in Scratch—a project that combines creativity, problem-solving, and interactive design. Using Scratch's pen extension, you'll build an interactive drawing app complete with a color palette, brush size controls, and an eraser tool!

What Will You Learn?

By the end of this blog and video, you'll master:

  • • How to use the Pen extension in Scratch
  • • How to create an interactive Scratch color palette
  • • How to implement brush size controls using variables
  • • How to add an eraser tool in Scratch
  • • How to build your own Scratch drawing app from scratch!
  • • How to use drag and drop programming blocks effectively

Whether you're a parent, a coding instructor, or a curious learner, this Scratch project is perfect for teaching coding games for kids while fostering creativity.

Tools & Concepts Used

  • • Scratch 3.0
  • • Pen extension in Scratch
  • • Variables (Size, Color)
  • • Motion, Control, Looks, Events, Sensing, and Operators blocks
  • • Custom sprites (Color buttons, eraser, and canvas)
  • • Basic block programming logic

Scratch Coding Tutorial: Build a Scratch Painting App

Let's break down the process into clear steps with code examples.

1. Scratch Painting App Tutorial: Set Up Your Project for Kids

👀 Watch this section in video: Set Up Your Scratch Project

  1. Open Scratch 3.0 and create a new project.
  2. Delete the default cat sprite.
  3. Click "Choose a Sprite" → "Paint" to draw a blank canvas.
  4. Name this sprite Canvas.

Code for Canvas Sprite

when green flag clicked
set [Color v] to [black]
erase all
go to [Mouse pointer v]
forever
    go to [mouse pointer v]
    if  then
        pen down
    else
        pen up
    end
end

💡 This is the core drawing mechanic. The pen follows the mouse and draws only when clicked.

2. Scratch Pen Extension Guide: Add Pen for Drawing Tutorial

📌 Watch this short clip at Add the Pen Extension

To enable drawing, click on the "Extensions" button (bottom left) and choose the Pen extension.

Now, you'll have access to blocks like:

  • pen down
  • pen up
  • set pen color to
  • set pen size to
  • erase all

3. Scratch Variables Tutorial: Create Brush Size & Color for Painting App

📌 See it in action: Create Variables

Go to the Variables tab and create two variables:

  • Size (controls the brush size)
  • Color (stores the selected color as text, e.g., "red", "blue")

Also, turn Size into a slider:

  • Right-click Size and choose slider.
  • Set min to 5 and max to 100 for better control.

Set Pen Size Using Size Variable

when green flag clicked
set pen size to ((Size) / 5)

4. Scratch Color Palette Tutorial: Build Dynamic Buttons for Kids

📌 Detailed walkthrough: Build Your Color Palette

Paint several circle sprites with solid colors like red, blue, green, yellow, and black. Remove outlines.

For each, name the sprite accordingly (e.g., Red, Blue).

Example: Code for Red Palette Sprite

when green flag clicked
go to x: (-150) y: (140)
forever
    if  then
        set [brightness v] effect to (25)
    else
        set [brightness v] effect to (0)
    end

    if  then
        set [Color v] to [red]
    end
end

Repeat similar blocks for Blue, Green, Yellow, and Black.

5. Scratch Dynamic Pen Tutorial: Set Color Based on Palette Selection

📌 See it executed: Set Pen Color Dynamically

Back in your Canvas sprite, use conditionals to check which color is selected and set pen color accordingly.

if <(Color) = [red]> then
    set pen color to [#ff0000]
end
if <(Color) = [blue]> then
    set pen color to [#0000ff]
end
if <(Color) = [green]> then
    set pen color to [#00ff00]
end
if <(Color) = [yellow]> then
    set pen color to [#ffff00]
end
if <(Color) = [black]> then
    set pen color to [#000000]
end

Tip: Use the color picker to precisely match your palette buttons.

6. Scratch Eraser Tool Guide: Add Erase Function for Painting App

📌 Adding erase functionality: Add the Eraser Tool

Draw a rectangle sprite labeled "Eraser" with white text. This will reset the canvas.

Code for Eraser Sprite

when green flag clicked
go to x: (150) y: (140)
forever
    if  then
        set [brightness v] effect to (25)
    else
        set [brightness v] effect to (0)
    end

    if  then
        erase all
    end
end

Full Workflow Video

See the full process in action on YouTube:👉 Kodex Academy – Scratch Painting App Tutorial

Scratch Painting App Enhancements Tutorial: Features to Try Next

Here are some project enhancement ideas to take your Scratch painting app to the next level:

1. Scratch Save Feature Tutorial: Export Drawings from Painting App

Turn your project into keepsakes! While Scratch can't export files directly, add a "Save" button that takes a screenshot prompt and shares their art on the Scratch community. This teaches digital sharing and builds excitement—perfect for parent-kid collaborations.

Bonus: Add a "Share Story" sprite that says, "Show your family what you created!"

when this sprite clicked
broadcast [take screenshot v]
say [Great job! Share your painting on Scratch community!] for (3) seconds
switch costume to [celebration v]

2. Scratch Brush Selector Guide: Add Custom Types for Drawing Fun

Make your brush a shape-shifting wizard! Let's switch between a round dot (circle), straight line, or sparkly spray (using clones for dots). This sparks creativity—like drawing fireworks or dotted lines—and introduces conditionals. Challenge: Let them mix brushes mid-draw for hybrid art!

Use buttons to switch between:

  • • Circle brush
  • • Line brush
  • • Spray brush (simulate using clones)
when [circle button v] clicked
set [BrushType v] to [circle]
say [Round brush ready – draw some bubbles!] for (2) seconds

when [line button v] clicked
set [BrushType v] to [line]
say [Line brush on – perfect for straight edges!] for (2) seconds

when [spray button v] clicked
set [BrushType v] to [spray]
say [Spray brush activated – make it rain colors!] for (2) seconds

// In canvas forever loop:
if <(BrushType) = [circle]> then
  pen down
  move (Size) steps
else
  if <(BrushType) = [line]> then
    pen down
    repeat (5)
      move (Size / 5) steps
    end
  else  // spray
    repeat (3)
      create clone of [dot v]  // Small dot sprite
      pen up
    end
  end
end

3. Scratch Color Picker Tutorial: Advanced Palette for Kids Painting

Unlock the rainbow vault! Instead of fixed colors, let kids mix their own using RGB sliders (Red, Green, Blue)—watch the pen color change live like magic paint. This dives into math (0-100 values) and variables, turning your app into a pro artist's toolkit. Fun twist: Add a "Surprise Me" button for random colors!

Create three variables: Red, Green, Blue, and dynamically update the pen color using the RGB values.

when green flag clicked
set [Red v] to [50]
set [Green v] to [50]
set [Blue v] to [50]
show variable [Red v]
show variable [Green v]
show variable [Blue v]

// Update pen color dynamically (in canvas script):
set pen color to ((Red * 255 / 100) + (Green * 255 / 100) + (Blue * 255 / 100))  // Simplified RGB mix

// Surprise button:
when [surprise v] clicked
set [Red v] to (pick random (0) to (100))
set [Green v] to (pick random (0) to (100))
set [Blue v] to (pick random (0) to (100))
say [Random rainbow magic!] for (2) seconds

4. Scratch Undo Redo Tutorial: Add History for Painting App Mistakes

Oops-proof your art! Let kids rewind the last 5-10 strokes like a time machine, or redo them for "what if" fun. This teaches lists and loops while building confidence—great for wiggly hands or experimental doodles. Pro tip: Limit to 5 actions to keep it simple and fast.

when [undo v] clicked
if <(length of [DrawingHistory v]) > [0]> then
  delete (length of [DrawingHistory v]) of [DrawingHistory v]  // Pop last action
  erase all  // Redraw from history (loop to replay)
  repeat (length of [DrawingHistory v])
    // Re-apply saved pen settings and positions
    set pen color to (item (1) of [DrawingHistory v])
    pen down
    move (item (2) of [DrawingHistory v]) steps
  end
  say [Undid last stroke – keep creating!] for (2) seconds
end

when [redo v] clicked
// Similar logic but add back from a RedoHistory list
say [Redoing magic!] for (2) seconds

// In main drawing loop (save actions):
add (pen color) to [DrawingHistory v]
add (Size) to [DrawingHistory v]  // Save state every few moves

5. Scratch Shape Tools Guide: Add Square/Circle to Painting App

From doodles to designs! Equip your app with quick buttons for perfect squares, circles, and lines—no freehand wobbles needed. This blends Pen with geometry math (repeats/turns), inspiring kids to create logos or patterns. Challenge: Add a "Fill Shape" option for solid colors!

Implement shortcuts to draw:

  • • Squares
  • • Circles
  • • Lines

Let users choose by clicking tool icons.

when [square button v] clicked
define [draw square v]
pen down
repeat (4)
  move (50) steps
  turn right (90) degrees
end
pen up
say [Square drawn – try a house next!] for (2) seconds

when [circle button v] clicked
define [draw circle v]
pen down
repeat (36)
  move (10) steps
  turn right (10) degrees
end
pen up
say [Circle complete – draw a sun!] for (2) seconds

when [line button v] clicked
pen down
move (100) steps
pen up
say [Straight line ready – connect the dots!] for (2) seconds

// Call in main script:
broadcast [draw square v]  // From button click

Educational Benefits of This Scratch Project

By building this Scratch painting game, kids will:

  • • Learn how to code in Scratch using visual logic
  • • Understand event-driven programming
  • • Practice looping and conditionals
  • • Explore creative thinking and UI design
  • • Develop real game development logic in a simplified form

It's one of the most rewarding fun coding activities for kids that's both entertaining and educational.

What Makes This Project Great for Scratch Coding Classes?

This painting app is ideal for teachers running Scratch coding classes. Here's why:

  • • Easy to scaffold in multiple sessions
  • • Introduces core programming concepts visually
  • • Allows personalization and creativity
  • • Engages students with immediate visual feedback
  • • Prepares kids for more advanced Scratch game tutorials

Looking for more Scratch tutorials? Check out Scratch's official guides.

FAQ: Frequently Asked Question

Question Answer
How to add Pen extension in Scratch? Extensions > Pen; use pen down/up for drawing.
How to create a color palette in Scratch? Paint circle sprites for colors; on click, set pen color variable.
How to make brush size variable in Scratch? Create 'Size' variable as slider (5-100); set pen size to it.
How to add an eraser in Scratch painting app? Sprite on click: set pen color to white or erase all.
What is the best age for this Scratch project? Ages 6-12: Basics for young, enhancements for older.
How to make the pen follow the mouse in Scratch? Forever loop: go to mouse-pointer, if mouse down then pen down.
Remix ideas for Scratch painting app? Add stamps, undo button, save drawing.

Scratch Painting App: Summary of Steps

Build a Scratch Painting App for Kids

Step-by-step: Project setup, Pen extension, variables for size/color, palette sprites, dynamic pen/eraser, and enhancements like save, brush selector, color picker, undo/redo, shape tools, plus teaching tips.

Total Time: 60 minutes

Scratch Painting App Setup Tutorial: Set Up Your Project for Kids

Create new project, delete default cat, paint blank canvas sprite named 'Canvas'.

Scratch Pen Extension Guide: Add Pen for Drawing Tutorial

Extensions > Pen; access blocks like pen down/up, set color/size, erase all.

Scratch Variables Tutorial: Create Brush Size & Color for Painting App

Add 'Size' (slider 5-100) and 'Color' variables.

Scratch Color Palette Tutorial: Build Dynamic Buttons for Kids

Paint circle sprites for colors; on click, set pen color.

Scratch Dynamic Pen Tutorial: Set Color Based on Palette Selection

In Canvas: If touching red sprite, set pen color to red; repeat for colors.

Scratch Eraser Tool Guide: Add Erase Function for Painting App

Create eraser sprite; on click, set pen color to white or erase all.

Scratch Save Feature Tutorial: Export Drawings from Painting App

Add 'Save' button that broadcasts screenshot prompt.

Scratch Brush Selector Guide: Add Custom Types for Drawing Fun

Switch between circle/line/spray brushes via buttons.

Scratch Color Picker Tutorial: Advanced Palette for Kids Painting

Add RGB sliders for custom colors.

Scratch Undo Redo Tutorial: Add History for Painting App Mistakes

Use list for drawing history; undo pops last action.

Scratch Shape Tools Guide: Add Square/Circle to Painting App

Buttons for geometric shapes.

Scratch Teaching Tips Tutorial: Integrate Painting App in Classroom

Use for math (angles), creativity (free draw), problem-solving (undo). Ages 6-12; 30-45 min sessions.

🎨 Ready to Create Your Own Painting App?

Building a Scratch painting app is a perfect blend of fun and education. Whether you're a young coder or a mentor guiding students, this project is a great way to explore the power of drag and drop programming in Scratch.

If you enjoyed this guide, be sure to share it with fellow educators or parents who want their kids to learn Scratch programming in a joyful, creative way.

  1. Don't forget to check out the full video tutorial by Kodex Academy here: 🎥 Watch the full Scratch Painting App Tutorial
  2. Like, comment & share the video
  3. Visit kodexacademy.com
  4. Subscribe to the Kodex Academy YouTube channel for deeper Scratch content.

Happy coding with Kodex Academy! 🚀

Share This Tutorial

Help other kids learn Scratch programming! Share this tutorial with friends and family.