UNIT 5
Scratch Programming – In Essentials
of Computing
• Scratch is a block-based visual programming language developed by
MIT. It is mainly used for beginners to learn programming concepts in
a simple and interactive way.
Why Scratch is Used in Essentials of
Computing?
Scratch is a block-based visual programming language that allows users
—especially beginners and school students—to learn programming
concepts by creating interactive stories, games, and animations.
Instead of typing code, Scratch uses drag-and-drop blocks, making it
easy to understand logic without worrying about syntax.
Main Components of the Scratch Environment:The
Scratch interface has several important components:
1. Stage Area
The Stage is the main display screen where the program runs.
All characters (sprites) perform actions on this stage.
It acts like a “playground” for your animations and games.
The stage has backdrops which can be changed to create different scenery.
2. Sprites
Sprites are the characters or objects in Scratch.
They can be animals, people, cars, balls, or even user-drawn images.
Each sprite can have:
Costumes (different looks)
Scripts (programs)
Sounds
3. Block Palette
•Located on the left side.
•Contains all the programming blocks grouped in categories such as:
• Motion
• Looks 5. Costumes Tab
• Sound •A section where you can:
• Events • View and edit different costumes of a sprite.
• Control • Draw your own costumes.
• Sensing • Import images from the library.
• Operators •Useful for creating animations (changing costumes makes a
• Variables sprite “move”).
•Blocks are dragged from this palette and used to create a script.
4. Script Area 6. Sounds Tab
•The space where you assemble the code blocks. •Allows you to:
•Scripts created here control how the sprites behave. • Add sounds or record your own voice.
•Blocks snap together like puzzle pieces to form a complete • Play music, sound effects, or narration in your project.
program. •Each sprite can have its own set of sounds.
7. Menu and Control Components (5 lines)
[Link] has menu components at the top to manage the
project.
[Link] include File, Edit, Tutorials, and Project title options.
[Link] components are blocks used to control the program
flow.
[Link] include loops, conditionals, events, and wait blocks.
[Link], they help create, manage, and control Scratch
programs easily.
Building a Scratch Project
1. Users start by adding sprites to the stage and then use the block palette to drag blocks into
the script area, forming sequences of actions.
Users choose characters (sprites) and place them on the stage.
They then build programs by dragging blocks into the script area to create step-by-step actions.
2. Event blocks often begin scripts (e.g., “When green flag clicked”) and trigger the action.
Most Scratch programs start with an event block that tells the script when to run.
The green flag, key press, or mouse click can act as the starting trigger.
3. Motion, looks, and sound blocks make sprites perform visible and audible actions.
Motion blocks move the sprite, while looks blocks change appearance or show text.
Sound blocks let the sprite play music or sound effects during the project.
4. Control and sensing blocks allow for interactive and responsive programs, enabling loops,
decisions, and responses to user input.
Control blocks manage repetition, timing, and conditions in the program.
Sensing blocks detect user actions like key presses or touching objects, making the project
interactive.
Visual Representation
• Scratch has a user-friendly and clear interface where block
categories, sprites, and the working area are neatly separated, making
it easy to find and use each part.
•
Diagrams usually show the stage, sprite list, script area, and tabs,
helping beginners understand how everything fits together.
•
Scratch helps students learn logic and creativity because it uses visual
blocks to build programs step by step and gives instant feedback on
the stage.
Paint Editor in Scratch
The Paint Editor in Scratch is a tool used to create, edit, or customize costumes for
sprites and backdrops.
Students can draw shapes, add colors, erase parts, and design their own characters
using this editor.
Modes of the Paint Editor
🔹 1. Vector Mode
Vector mode allows you to draw smooth, scalable shapes.
You can resize or stretch drawings without losing quality, and edit each shape separately.
🔹 2. Bitmap Mode
Bitmap mode lets you draw using pixels, like traditional painting.
It is useful for detailed or pixel-style drawings but may become blurry when enlarged.
Main Tools and Features of the Paint Editor in Scratch
[Link] Tool – Used to free-draw lines and shapes.
[Link] Tool – Removes unwanted parts of the drawing.
[Link] Tool (Bucket) – Fills areas with colors or gradients.
[Link] Tool – Selects parts of the drawing to move, resize, or rotate.
[Link] Tool – Adds text to costumes or backdrops.
[Link] Tools – Draws rectangles, circles, lines, and polygons.
[Link] Picker – Allows choosing and matching colors.
[Link] & Fill Options – Adjusts thickness of lines and fills inside shapes.
[Link]/Ungroup – Combine or separate objects (mainly in vector mode).
[Link], Flip, and Resize – Helps adjust the shape and orientation easily
Using the Paint Editor – With Example Shape
When using the Paint Editor in Scratch, students can draw and design shapes using tools
like Brush, Shapes, Fill, and Select.
✔ Example: Drawing a Simple Circle
[Link] the Paint Editor and select Ellipse (Circle) Tool.
[Link] the mouse on the canvas to create a circle.
[Link] the Fill Tool to add color inside the circle (e.g., blue).
[Link] the Outline Tool to change the border thickness or color.
[Link] needed, use Select Tool to move, resize, or rotate the circle.
✔ Example: Drawing a House Shape
[Link] a square for the house using the Rectangle tool.
[Link] a triangle on top using the Polygon tool to make the roof.
[Link] both shapes with colors (e.g., red roof, yellow house).
[Link] windows using smaller rectangles and circles.
[Link] the Text Tool if you want to label your house.
Vector Mode vs Bitmap Mode – Tabular
Comparison
Feature Vector Mode Bitmap Mode
Graphics Smooth, clean, scalable shapes Pixel-based graphics; may blur when enlarged
Edit each shape separately (move,
Editing Edits pixels directly like painting/eraser
resize, group)
Neat shapes, characters, logos,
Best For Pixel art, detailed coloring, shading
large drawings
Quality Does not lose clarity when resized Quality reduces when enlarged
Switching Convert to Bitmap option Convert to Vector option
Advantages of the Paint Editor in Scratch
[Link] to Use: The tools are simple and beginner-friendly, making it easy for students to
create drawings.
[Link] Costumes: Users can design their own characters, shapes, and backgrounds for
projects.
[Link] Modes: Offers both Vector and Bitmap modes for smooth shapes or detailed pixel art.
[Link] Editing: Shapes can be resized, rotated, flipped, and recolored quickly.
[Link] Creativity: Encourages students to be creative by designing visuals for stories and
games.
[Link]-in Tools: Provides shapes, brush, text, fill, and eraser tools for flexible designing.
[Link] Preview: Changes appear instantly on the stage, helping learners improve their
design.
5.3 SCRATCH BLOCKS
•Scratch blocks are the main coding elements used to create programs in Scratch.
•They are color-coded, meaning each color represents a different type of action like
motion, looks, or sound.
•The blocks have unique shapes that show how they connect with other blocks.
•Blocks snap together vertically like puzzle pieces, making it easy for
students to build scripts.
•By connecting these blocks, users can create interactive stories, games,
and animations without typing code.
Block Shapes and Their Roles
Scratch blocks come in different shapes, and each shape has a special role in how the program works.
🔹 1. Hat Blocks (Rounded Top)
These blocks start a script.
Example: When green flag clicked begins the program.
🔹 2. Stack Blocks (Rectangle with Notches)
These are the most common blocks.
They perform actions like moving, turning, or saying something.
🔹 3. Boolean Blocks (Hexagon Shape)
These blocks give True/False answers.
Used inside conditions like if or repeat until.
Example: touching edge?
🔹 4. Reporter Blocks (Rounded Rectangle)
These blocks report a value like score, position, or mouse X.
They fit inside other blocks as inputs.
🔹 5. C-Shaped Blocks (Opening in the Middle)
These blocks control loops or conditions.
Example: repeat or forever blocks wrap around other blocks.
How Scratch Blocks Are Used
[Link] blocks are dragged from the block palette and placed into the script area.
[Link] snap the blocks together like puzzle pieces to form a sequence of actions.
[Link] usually start with an event block (example: “When green flag clicked”).
[Link] blocks like motion, looks, or sound are added under the event block.
[Link], sensing, and operator blocks help make the program interactive and logical.
Example
✔ Example: Moving a Sprite Forward
•Drag the event block:
When green flag clicked
•Drag a motion block under it:
move 10 steps
Result:
When you click the green flag, the sprite moves
forward 10 steps.