Computer Science Notes for Class IV
Chapter – Scratch
Introduction to Scratch 3.0
o Scratch is a visual programming language designed to help users learn
coding through interactive and creative projects.
o Scratch 3.0 is a free desktop-based version of the software.
o It has been developed by MIT.
Parts of the Scratch Window
Menu
Flags
Stage
Blocks
Block
Groups Sprite
Add
Backdrop
Button
Add
Sprite
Button
o Stage: The area where the action occurs (shows the code output).
o Sprites: Characters or objects you control in your projects (animals,
vehicles, etc.).
o Backdrops: The background images for your stage.
o Blocks Palette: Contains programming blocks to control your sprites
and their actions.
o Scripts Area: The workspace where you drag and snap blocks together
to create programs.
o Blocks: Color-coded blocks that perform specific tasks (motion,
control, events, etc.).
o Sprite List: Shows the current sprites in the project. You can add or
delete sprites here.
Basic Building Blocks
o Motion Blocks: Move sprites, rotate them, and change their size.
o Looks Blocks: Change how sprites appear (show, hide, change
costumes, say something, etc.).
o Sound Blocks: Add sounds and music to projects.
o Events Blocks: Used to initiate actions like when the green flag is
clicked or when a key is pressed.
o Control Blocks: Create loops, conditional statements, and triggers.
o Sensing Blocks: Detect conditions (e.g., touching edge, keyboard
keys).
o Operators Blocks: Perform calculations
o Variables: Store data values (like score, time).
Working with Sprites
o Choosing Sprites: Click the 'Choose a Sprite' button to
select from built-in characters or upload your own.
o Costumes: Customize the appearance of your sprite.
You can create new costumes for animation.
o Scripts: Drag and snap blocks together to create instructions that
control sprite actions.
Using the Backdrop
o Change backdrops programmatically to create scene changes in a story.
o Use "Switch backdrop" or "Next backdrop" blocks to create a sequence.
Input in Scratch
Ask Block: Prompts the user for input.
Answer Variable: Stores the user's response for later use.
Looping Blocks
1. Repeat X Times: Executes a code block for a fixed number of repetitions.
2. Forever: Continuously repeats an action.
3. Repeat Until: Continues repetition until a specified condition is met.
o Example: End game loop based on reaching a score.