Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

INTRODUCTION TO SCRATCH

• Scratch is a beginner-friendly visual platform developed by MIT.


• It allows users to create interactive stories, games, animations and
more by snapping together code blocks.
• Scratch is designed to teach coding concepts through a simple and
engaging interface, making it accessible to people of all ages,
especially kids and beginners.
• Users can share their projects on the Scratch website, fostering a
creative and collaborative coding community.
• It’s an excellent tool for learning the basics of coding and
computational thinking.
HISTORY
• Scratch is a Visual programming Language
• A Scratch Online Community is created by the

Lifelong Kindergarten Group at the MIT Media Lab.


• It was first developed in 2003 by Mitchel Resnick
and his team.
SCRIPTS
TOOLBAR

MENUBAR
BLOCKS
SCRATCH CATEGORY
STAGE
FULL
SCREEN

SCRIPTS
AREA
SPRITE
X & Y COORDINATES
OF THE SPRITE

BLOCKS
TOOLS TO TOOLS TO
EDIT STAGE EDIT SPRITE

ACTIVE
SELECT SPRITE SPRITE LIST
STAGE AREA
SCRIPTS
TAB,
COSTUMES
TAB &
SOUND TAB
SCRATCH INTERFACE IS A USER-FRIENDLY PLATFORM FOR
CREATING INTERACTIVE STORIES, GAMES, AND ANIMATIONS.
Here is an overview:
1. Stage: The main area where you create and view your project.
2. Sprites: Characters or objects that you can animate and program.
3. Blocks Palette: Contains coding blocks that you drag and snap together to create scripts.
4. Scripts Area: Where you assemble code by stacking blocks to control the behavior of sprites.
5. Costumes: Different appearance for your sprites.
6. Sounds: Audio files that can be added to your project.
7. Backdrops: Backgrounds for the stage.
8. Stage Monitor: Shows the current values of variables and can be used for debugging.
9. Toolbar: Contains various tools for drawing, importing media and controlling your project.
10. Green Flag and Stop sign: Control buttons to start and stop your project.
11. Tips: Offers helpful information and suggestions.
12. Stag Backdrop Selector: Lets you choose different backgrounds for the stage.
SPRITES AND BACKDROPS
In Scratch, sprites and backdrops are essential elements that you use to create
interactive animations and games
SPRITES: Sprites are the characters or objects that you can program to move,
respond to user input, and interact with other sprites. To create a sprite, you
can either choose from the built-in library of sprites or draw your own using
the built-in editor. You can also import external images to use as sprites.
BACKDROPS: Backdrops are the backgrounds for your scratch projects. You
can use them to set the scene or environment for your project. Scratch
provides a library of backdrops using the backdrop editor. You can change the
backdrop to create different scenes in your animation or games.
You can program both sprites and backdrops in Scratch using Scartch’s visual
coding blocks. These blocks allow you to control the movement, appearance,
and behavior of your sprites and change the backdrop to create interactive and
dynamic projects.
CODE BLOCKS
Show basic examples of blocks and how they work.

In Scratch, the BLOCK CATEGORIES are a way of organizing blocks.


There are 9 built-in blocks available in Scratch, MOTION, LOOKS, SOUND, EVENTS,
CONTROL, SENSING, OPERATORS, VARIABLES, AND MY BLOCKS.

In Scratch, you don’t use traditional code blocks like in text based programming
languages. Instead, you use a visual coding system that involves snapping together
various colorful blocks to create scripts. These blocks represent different
commands and actions.

To use code blocks in Scratch, simply drag and snap them together to build your
scripts. These blocks are designed to be user-friendly, making it easy for beginners
to create interactive animations and games.
Here’s  how you can use code blocks in Scratch.
Here’s  how you can use code blocks in Scratch.
CODE BLOCKS – CATEGORY OF BLOCKS

Event Blocks: These blocks trigger your script when a specific event occurs, like “When Green Flag
Clicked” or “ When Space Bar Key is pressed”
Motion Blocks: These blocks control the movement of sprites, including”Move”, “Turn”, “Go to x:
y:”.
Looks Blocks: These blocks modify the appearance of your sprite, including “Say”, “Set Costume”
and “Switch Costume”
Sound Blocks: These blocks control sound effects like “Play Sound” or “Stop All Sounds”
Control Blocks: These blocks manage the flow of your script. including, “Wait”, “Repeat”, and If-
then
Sensing Blocks: These blocks allow your sprite to sense the environment, such as “Touching color”
or “Key Pressed”
Operators Blocks: These blocks perform mathematical and logical operations, like “Add”.
“Subtract”, and “Greater than”
Variables Blocks: You can create and use variables with blocks like “Set variable” and “Change
variable”
Here’s  basic example of a Scratch script:
CODE BLOCKS - FUNCTIONALITY

Event Blocks: Start with an event block like “When Green Flag Clicked”, This block initiates your
script when you click the green flag in the Scratch stage.
Motion Blocks: Add a motion block, such as “Go to x:___ y:___” to position a sprite on the stage.
Looks Blocks: You can use looks blocks to change the appearance of your sprite, like “Say
[message]” to make your sprite say something.
Sound Blocks: If you want to add sound, use sound blocks like “Play Sound [sound name]”
Control Blocks: To control the flow of your script, use control blocks like “Wait___ seconds” to
introduce a pause.
Repeat Block: You can use a repeat block to execute a set of actions multiple times.
Sensing Blocks: You can use sensing blocks“Key Pressed”
Operators Blocks: These blocks perform mathematical and logical operations, like “Add”.
“Subtract”, and “Greater than”
Variables Blocks: You can create and use variables with blocks like “Set variable” and “Change
variable”
Custom Blocks: You can create your own custom blocks to simplify and organize your scripts.
 Blocks are puzzle-piece shapes that are used to create code in Scratch.
 The blocks connect to each other vertically like a jigsaw puzzle, where
each block type (HAT, STACK, REPORTER, BOOLEAN, or CAP) has its
own shape and its own slot shape for it to be inserted into.
 Series of connected blocks are called SCRIPTS.

A Hat Block is a block that starts a script when a


specific event occurs. They are shaped so no blocks can go
on top of them — this is done by rounding the blocks' top. The
bottom of Hat blocks are the same as Stack Blocks.

CODE
BLOCKS A Stack block is a rectangular block that is shaped to fit above
and below other blocks. Stack blocks make up the majority of
the blocks available in Scratch, being available in every non-
extension category except Operators.
When 2 stack blocks are connected to form a script their
commands will execute in the order from top to bottom.
CODE BLOCKS IN SCRATCH… HOW TO USE

In Scratch, you can create code blocks, or scripts, to control the behavior of sprites. Here’s a
basic overview of how to create code blocks in Scratch. Remember that Scratch uses a block
based, drag and drop interface.
1. Choose a Sprite: Select the sprite you want to add code to by clicking on it in the STAGE AREA/SPRITE
LIST AREA
2. Create an Event Block: To start a script, you often want it to respond to an event, such as when the
green flag is clicked. To do this, go to the “Events” category in the blocks palette and drag the “When green
flag clicked” block to the scripting area.
3. Add Commands from the different block categories like “Motion”, “Looks”, “Sound”, and more, you
can drag and snap blocks together to create a sequence of commands.
4. Use control blocks: You can use control blocks like “If”, “repeat”, and “forever” to add conditional or
looping behavior to your scripts. These are under the “Control” category.
5. Costume blocks: If you have a sequence of commands you want to reuse, you can create a custom
block. This is useful for making your code more organized and easier to manage. Go to “My Blocks” and click
“Make a Block” to create a custom block.
6. Testing: Click the green flag to start your script or use other event triggers you’ve set up to test your
code..
7. Save and share: Once you’ve created your code blocks, you can save your project and share it with
SCRIPTS IN SCRATCH
Scratch is a visual programming language designed for beginners.
A script is a collection of blocks that interlock with one another. A script defines what kind of operation
should be done by the sprite. It tells the characters what to do or say. Every single sprite is programmed
with a script.
You can create scripts by dragging and snapping together blocks that represent code.
Every block's shape is designed so that it can do one or more of the following:
• Hat Blocks start a script. These can only be placed on top of stack blocks, C blocks, or cap blocks.
• Stack Blocks add to the end of a script, and can also be inserted elsewhere. These can be placed on
top of or below other stack blocks, inside a C block, below a hat block, or on top of a cap block.
• Cap Blocks end a script. These can only be placed below stack blocks, C blocks, or cap blocks.
• Reporter Blocks and Boolean Blocks report values to be used by other blocks. These can only be
placed inside other blocks, and often can be placed inside themselves.
• Various blocks of the types above can contain reporter blocks and/or Boolean blocks.
In this way, blocks can be assembled like a jigsaw puzzle to create scripts. Each command block in these
SCRIPTS are executed once in sequence, with no skipping or jumping
SCRIPTS
IN
SCRATCH
EVENTS EVENTS AND ACTIONS
Events in computer science are the triggers for making action happen. These
triggers initiate actions in your Scratch project. These triggers like keyboard
presses, mouse clicks, or even specific condition like “when the green flag is
clicked” or “when the sprite is touched”.
YOU CAN USE EVENT BLOCKS TO SET UP EVENT-DRIVEN PROGRAMMING IN SCRATCH.
In scratch, an event is a specific action or occurrence that triggers a script or set of
scripts to run. it can be any user input, such as clicking a sprite, pressing a key on
the keyboard, or when a certain condition is met. Events are used to make programs
more Interactive and dynamic.
ACTIONS are the instructions or behaviors that you want your sprites and
objects to perform in response to events. You can control actions using various
programming blocks in Scratch, such as moving a sprite, changing its costume,
playing sounds and more. These actions are often placed inside event blocks to
specify what should happen when a specific event happens.
HAT
HAT
BLOCKS
BLOCKS
SCRIPTS IN SCRATCH
Scratch is a visual programming language designed for beginners. You can create
scripts by dragging and snapping together blocks that represent code. Here’s a
basic example of a Scratch script:

https://www.geeksforgeeks.org/script-in-scratch-programming/
https://www.geeksforgeeks.org/script-in-scratch-programming/?ref=ml_lbp
Variables and Loops
• Introduce the concept of variables and loops
• Provide examples of how to use them.

You might also like