0% found this document useful (0 votes)
69 views40 pages

Scratch Programming Lower Primary - Year 5&6 - Copy - 1741958593

Scratch is a block-based programming language designed for creating animations, games, and interactive stories, making coding accessible without complex syntax. The interface includes a stage for sprite actions, a blocks palette for programming, and various types of blocks for motion, looks, sound, events, control, sensing, and operators. Users can easily manipulate sprites and create interactive projects through simple drag-and-drop mechanics.

Uploaded by

nisaranisar85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views40 pages

Scratch Programming Lower Primary - Year 5&6 - Copy - 1741958593

Scratch is a block-based programming language designed for creating animations, games, and interactive stories, making coding accessible without complex syntax. The interface includes a stage for sprite actions, a blocks palette for programming, and various types of blocks for motion, looks, sound, events, control, sensing, and operators. Users can easily manipulate sprites and create interactive projects through simple drag-and-drop mechanics.

Uploaded by

nisaranisar85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

SCRATCH PROGRAMMING (Introduction)

LOWER SECONDARY
Scratch Programming

What is Scratch?

 Scratch is a block-based
programming language that
allows us to create animations,
games, and interactive stories.
 It helps us learn coding logic
without typing complex code.
Understanding the Scratch
Interface
How to Open Scratch

 Go www.scratch.mit.edu
 Click Create to start a new
project.
Scratch Interface

Scratch interface

 Stage – The area where the sprites (characters)


perform actions.
 Sprites – Characters or objects in Scratch that can be
programmed.
 Blocks Palette – Contains different categories of
blocks to control sprites.
 Script Area – The workspace where you arrange
blocks to create programs.
 Green Flag – Starts the program.
 Stop Button – Stops the program.
Scratch Blocks
Types of Blocks in Scratch

 Motion Blocks – Move and control sprites (e.g., move 10 steps, turn 15
degrees).
 Looks Blocks – Change appearance (e.g., say “Hello”, change
costume).
 Sound Blocks – Play sounds (e.g., play a sound, change volume).
 Events Blocks – Start actions (e.g., when green flag clicked, when key
pressed).
 Control Blocks – Repeat or wait (e.g., repeat 10 times, wait 1 second).
 Sensing Blocks – Detect changes (e.g., touching a color, mouse
position).
 Operators Blocks – Perform calculations (e.g., add, subtract, compare
values).
 Variables Blocks – Store values and data (e.g., score, player name).
Motion Block

Move and turn

 Move 10 Steps: Moves the sprite forward 10


steps in its current direction.
 Turn 15 Degrees: Rotates the sprite 15 degrees
to change its orientation.
 Turn 15 Degrees: Rotates the sprite another 15
degrees, further adjusting its direction.
Motion Block

Change position/spot
 Go to Random Position: Moves the
sprite instantly to a random spot on the
stage.

 Go to x: 48 y: 59: Moves the sprite


instantly to the coordinates (48, 59).

 Glide 1 secs to Random Position:


Smoothly moves the sprite to a random
position over 1 second.

 Glide 1 secs to x: 48 y: 59: Smoothly


moves the sprite to (48, 59) over 1
second.
Motion Block

Point in Direction

 Point in Direction 90: Sets the sprite to face


90 degrees (right).

 Point Towards Mouse-Pointer: Makes the


sprite face the mouse-pointer's current position.
Motion Block

Change sprite positions

 Change x by 10: Moves the sprite 10 units


horizontally to the right.

 Set x to 48: Positions the sprite at x-coordinate


48.

 Change y by 10: Moves the sprite 10 units


vertically upwards.

 Set y to 59: Positions the sprite at y-coordinate


59.
Motion Block

If on Edge, Bounce:

 Function: Makes the sprite bounce back


when it reaches the edge of the stage,
reversing its direction.

 Usage: Useful for keeping the sprite


within the visible area of the stage, often
used in animations and games.
Motion Block

Set Rotation Style Left-Right

 Function: Restricts the sprite's rotation to


only left and right, preventing it from
rotating upside down.

 Usage: Useful for sprites that should only


face left or right, such as characters in a
platformer game.
Motion Block

Positions

 x position: Reports the sprite's current


horizontal (x) coordinate.

 y position: Reports the sprite's current vertical


(y) coordinate.

 direction: Reports the sprite's current facing


direction in degrees.
Looks Block

Say (Output)

 Say "Hello!" for 2 seconds: Displays "Hello!"


in a speech bubble for 2 seconds.

 Say "Hello!": Displays "Hello!" in a speech


bubble until changed.

 Think "Hmm..." for 2 seconds: Displays


"Hmm..." in a thought bubble for 2 seconds.

 Think "Hmm...": Displays "Hmm..." in a


thought bubble until changed.
Looks Block

Switch costume & Backdrop

 Switch Costume to Costume2: Changes the


sprite's appearance to "Costume2".

 Next Costume: Cycles the sprite to the next


costume in its list.

 Switch Backdrop to Backdrop1: Changes the


stage background to "Backdrop1".

 Next Backdrop: Cycles the stage to the next


backdrop in its list.
Looks Block

Change sprite size

 Change Size by 10: Adjusts the sprite's size by


10%.

 Set Size to 100%: Resets the sprite's size to its


original 100%.
Looks Block

Change Sprite color and Graphics effects


Looks Block

Show and Hide Sprite

 Show: Makes the sprite visible on the stage.

 Hide: Makes the sprite invisible on the stage.


Looks Block

Move the Sprite between layers

 Go to Front Layer: Moves the sprite to the top


layer.

 Go Forward 1 Layer: Moves the sprite one


layer forward.
Looks Block

Costume & Backdrop number and sizes

 Costume Number: Reports the sprite's current


costume number.

 Backdrop Number: Reports the stage's current


backdrop number.

 Size: Reports the sprite's current size as a


percentage.
Sound Block

Play, Start and Stop Sound

 Play Sound "Meow" Until Done: Plays


"Meow" and waits for it to finish.

 Start Sound "Meow": Plays "Meow" without


waiting.

 Stop All Sounds: Stops all currently playing


sounds.
Sound Block

Change/set pitch and clear sound effects

 Change Pitch Effect by 10: Adjusts the


sound's pitch by 10.

 Set Pitch Effect to 100: Sets the sound's pitch


to 100.

 Clear Sound Effects: Resets all sound effects


to their original state.
Sound Block

Change and set the volume

 Change Volume by -10: Lowers the volume by


10%.

 Set Volume to 100%: Sets the volume to


100%.

 Volume: Reports the current volume level.


Event Block

Start an action

 When Clicked: Starts the script when the green


flag is clicked.

 When Space Key Pressed: Starts the script


when the space key is pressed.

 When This Sprite Clicked: Starts the script


when the sprite is clicked.

 When Backdrop Switches to Backdrop1:


Starts the script when the backdrop changes to
Event Block

Loudness

 Function: Starts the script when the


detected loudness (from a microphone) is
greater than 10.

 Usage: Useful for creating interactive


projects that respond to sound levels, such
as clap detection or voice-activated actions.
Event Block

Broadcast

Broadcast is a way for one sprite to send a message to other sprites,


allowing them to trigger specific actions when they receive that
message

 When I Receive Message1: Starts the script


when "Message1" is received.

 Broadcast Message1: Sends "Message1" to all


sprites without waiting.

 Broadcast Message1 and Wait: Sends


"Message1" and waits for all scripts to finish.
Control Block

Wait

 Function: Pauses the script for 1 second


before continuing to the next block.

 Usage: Useful for creating delays or timing


events in animations, games, or other
projects.
Control Block

Loops: Repeat & repeat forever

 Repeat 10: Repeats the enclosed blocks 10


times.

 Forever: Continuously repeats the enclosed


blocks indefinitely.
Control Block

If then & If else

 If [Condition] Then: Executes enclosed blocks


if the condition is true.

 If [Condition] Then Else: Executes one set of


blocks if true, another if false.
Control Block

Wait/Repeat until

 Wait Until [Condition]: Pauses the script until


the condition is true.

 Repeat Until [Condition]: Repeats the


enclosed blocks until the condition is true.
Control Block

Stop all

 Stop All: Stops all scripts in the project, halting


all actions and animations.

 Usage: Useful for immediately ending all


activity in a project, such as in games or
interactive stories.
Control Block

A clone is a copy of a sprite that is created while the program


is running. Clones allow you to create multiple copies of a
sprite dynamically without manually duplicating them in the
editor.

 When I Start as a Clone: Triggers when a


clone is created.

 Create Clone of Myself: Creates a clone of the


sprite.

 Delete This Clone: Removes the current clone.


Sensing Blocks

Touching and Distance

 Touching Mouse-Pointer?: Checks if the sprite


is touching the mouse-pointer.

 Touching Color?: Checks if the sprite is


touching a specific color.

 Color is Touching?: Checks if a specific color


on the sprite is touching another color.

 Distance to Mouse-Pointer: Reports the


distance between the sprite and the mouse-
pointer.
Sensing
Blocks
In Scratch, the "ask [ ] and wait" block lets a sprite ask a question
and wait for user input. The response is stored in the "answer" block.

 Ask "What's your name?" and Wait:


Prompts the user for input and waits for a
response.

 Answer: Reports the user's response to


the most recent "ask" command.
Sensing Blocks

 Key Space Pressed?: Checks if the space key


is pressed.

 Mouse Down?: Checks if the mouse button is


pressed.

 Mouse X: Reports the mouse's current x-


coordinate.

 Mouse Y: Reports the mouse's current y-


coordinate.
Sensing Blocks

Set Drag Mode Draggable/Not draggable:

 Function: Makes the sprite draggable,


allowing it to be moved around the stage
with the mouse.

 Usage: Useful for creating interactive


elements that users can drag and drop.
Sensing Blocks

Timer

 Timer: Reports the elapsed time in seconds


since the last reset.

 Reset Timer: Resets the timer to zero.


Sensing Blocks

Timer

 Loudness: Reports the current loudness level


(0-100) detected by the microphone.

 Usage: Useful for creating projects that respond


to sound, such as clap detection or voice-
controlled actions.
Operators Blocks

Arithmetic Operators

 5 + 10: Adds 5 and 10 to get 15.

 10 - 5: Subtracts 5 from 10 to get 5.

 6 * 4: Multiplies 6 by 4 to get 24.

 4 / 2: Divides 4 by 2 to get 2.
Operators Blocks

Pick a Random number

 Function: Generates a random number


between 1 and 10, inclusive.

 Usage: Useful for introducing randomness


in games, simulations, or other projects.
Operators Blocks

Comparative Operators

 > (Greater Than): Checks if the left value is


greater than the right value.

 < (Less Than): Checks if the left value is less


than the right value.

 = (Equal To): Checks if the two values are


equal.

You might also like