SlideShare a Scribd company logo
Scratch
Table of contents
1
4
2
5
3
6
Creating
accustom
sprite
and
backdrop
Drawing
and
painting
tools
Creating a
costume or
a sprite
Changing
the size
of a sprite
Applying
image effects
on a sprite
AdvancedScripts in
Scratch
Table of contents
7 8
11
9
12
Using
Sound
Blocks
Accepting
Inputs from
the User
Sensing
blocks
Position
oaf
Sprite
Using
Variable
Blocks
Creating
variables
Using Control
blocks
10
Advanced
Scripts in
Scratch
1
What is Scratch ??
JavaScript-based codebase made up of
multiple components such as "Scratch-GUI,"
now based on a library from Blackly,
"Scratch-VM," which interprets code, and
"Scratch-Render," the rendering engine. The
Scratch Blocks are made using Blackly.
Advanced Scripts in Scratch
You have already learnt to animate sprite
using the Motion, Looks and Sound blocks
in Scratch. You have also learnt to add
sprite ,delete aspriteand control the position
of sprites.
Let’s see the working of the following script
to recall some of the script blocks....
Creating
accustom
sprite and
back drop....
2
You can draw your own sprites
(pictures or text) using the
Scratch Paint editor.
Sprite
Click the Paint option in the ‘Sprite’
section to open the Scratch Paint
editor. Here, you can draw your
sprite using the drawing and
painting tools.
Follow the image..
Sprite gallery
Create anything
with scratch
Show your creativity ....
Drawing and
painting
tools...
3
Tools
 Select:
The Select tool is used to select an are a
on the canvas and re locate ,stretcher
compress it or modify it.
Circle :
The circle tool is used to draw ovals or
perfect circles.
 Reshape :
This tool is used for bending or changing the
shapes of a sprite.
Rectangle:
The rectangle tool is used to create
rectangles .Click and drag the mouse to
draw a rectangle.
 Brush :
The Brush tool is used for free hand drawing
by clicking on and dragging the mouse
pointer. You can change the colour and size
of the brush.
 Eraser :
The eraser tool is used to remove (or erase)
a part of the drawing.
 Fill :
The paint bucket or fill tool is used to fill
colours only in closed objects. You cannot fill
the background with the paint bucket.
Text :
The text tool is used to type letters and
numbers on to the canvas .to type, click
anywhere on the canvas and start typing
when cursor appears
Line :
The line tool is used for drawing lines. To
draw line, press and hold the left mouse
button at the starting point ,then drag and
release I tat
Then ding point.
Creating
aces tome
for sprite...
4
Costume 2
Costume 3
Costume 1
7.Advanced Scripts in Scratch.pptx
● You can then use an aback drop
for you scratch project.
● The Looks category has blocks,
using which you can set or
change the backdrop.
● The given script can be used to
display a different back drop
one by one, from the list of back
drops.
7.Advanced Scripts in Scratch.pptx
Changing
the size of a
sprite
5
Changing the size of as prate makes it
bigger or smaller. You can change the
size of as prate by using the 'set size
'block in the Looks category. You can
use this feature to show a growing or
shrinking sprite in an animation
origami. There are two blocks
available for this, 'set size ’and
‘change size’ .Set size will set the
sprite to a specific size ,while change
size will change its sizably specific
amount
7.Advanced Scripts in Scratch.pptx
Using
Control
blocks
6
Control blocks are used to
control the way scripts
execute. Scratch 3 has the
following basic Control
blocks.
The script held inside this block will be
executed in a loop for a specified number
of times, before allowing the remaining
script to continue. This block can be used
to execute the same script repeatedly.
For example, in the adjacent script, the
repeat block is used to change the
costume of the sprite after every 5
seconds. It will repeat this 10 times before
coming to a stop.
Using
SoundBlocks
7
.
We know that sound can be played by
using Sound blocks in Scratch. The blocks
available in this category can be used to
control the volume, tempo and other
features of the sound being played.
Sounds can be added in Scratch by
importing sound files or recording a new
sound.
The given script will play the sound ‘Meow’
5 times, and gradually decrease the
volume each time.
.
Note that before executing the above script once
again, you need to run the block to set the
volume to its full value.
Uploadsound
Surprise
Record
Choose a sound
We can add new sounds by using the following options
•Upload Sound – to uploada soundfile
that is stored on your computer.
•Surprise – to add arandom soundfile
from the library.
•Record – to record your own sound
• Choose a sound –to choose a
sound from the library
Let use the different image effects on a sprite.
backdrops. You also learnt how to execute
scripts repetitively using control blocks and
applied special effects to sprites.
Let’s see the following script and recall
some of the blocks that we have used.
Assuming that the given script is created
for the Ballerina sprite, the output will show
the dancing Ballerina.
7.Advanced Scripts in Scratch.pptx
.
O9:Accepting Inputs from the User Sensing blocks
This category contains the blocks that are used to
accept inputs from the user/ keyboard.
It displays an input box and prompts the user to type
the input.
The input entered by the user is stored in the
variable. Let’s see the following script using the
Sensing blocks.
When the green flag is clicked, the sprite will ask for
‘What’s your name?’ and wait for an answer. Once the
user enters an answer and clicks on the blue check
mark, the sprite will display the entered name for 5
seconds.
7.Advanced Scripts in Scratch.pptx
7
.
Position of a Sprite
X and Y co-ordinates
.
CREDITS: This presentation template was created by Slidesgo, and
includes icons by Flaticon, and infographics & images by Freepik
The stage in Scratch can be divided into four
squares using a horizontal and a vertical line.
The four squares thus formed are called
quadrants. The horizontal line represents the
X-axis and the vertical line represents the Y-
axis. The ’ x’ position determines the horizontal
location of the sprite and ‘y’ position
determines the vertical location of the sprite.
The point at which the X and Y-axis meet is
called the origin. The value of x and y at origin
is zero.
origi
CREDITS: This presentation template was created by Slidesgo, and
includes icons by Flaticon, and infographics & images by Freepik
The value of x position of a sprite
increases from 0 to 240 when it
moves to the right from the origin and
decreases from 0 to -240 when the
sprite moves to the left from the
origin. Similarly, the value of y
position of a sprite increases from 0
to 180 when it moves up from origin
and it decreases from 0 to -180 when
the sprite moves down from the
origin.
x-y
You Can Show The Above Background On The Stage By Adding The Xy-grid From
The List Of Backdrops. The Position Of A Sprite On The Stage Is Decided By The
Values Of Its X And Y Coordinates.
If On Edge, Bounce
While Moving A Sprite On The Stage It Can Happen That The Sprite Might Go
Beyond The Boundaries Of The Stage And Disappear. To Avoid This, We Can Use
The If On Edge, Bounce Block.
This Block Checks To See If The Sprite Is Touching The Edges Of The Stage, And If
It Does, It Will Make The Sprite Turn Back In The Opposite Direction.
In The Following Script, The Fish Moves 10 Steps And Waits For 0.05 Seconds.
When It Reaches The Edge Of The Stage, It Will Change Its Direction Instead Of
Going Beyond The Stage Boundary.
Note That The Set Rotation Style Left-right Block Has Been Added To Avoid The
Sprite From Rotating Vertically.
CREDITS: This presentation template was created by Slidesgo, and
includes icons by Flaticon, and infographics & images by Freepik
8
.
Using Variable
Blocks
.
While creating scripts or programs,
we often need to use variables to
store values. A variable is a
placeholder for some value, similar
to the x and y variables in Algebra.
In Scratch, variables can be
uniquely labelled by you. They can
be used by just one sprite or by all
of your sprites.
7.Advanced Scripts in Scratch.pptx
.
Creating variables
.
9
.
Step 1: Select the Variable block.
Step 2: Click on Make a variable.
Step 3: Specify the name of the variable and click
OK.
Step 4: The name of the new variable appears with
a check box before it. You can now see the blocks
associated with the variable.
7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx

More Related Content

PPTX
Scratch programming introduction to game creation
Ankita Shirke
 
DOCX
Scratch for kids syllabus for 5 hours by bibek pandit
BibekPandit2
 
PDF
How do I learn to code with Scratch in AEP
socalternativeeducat
 
PPT
Scratch Lesson 1 – Basics
David Oromaner
 
PDF
Getting-Started-With-Scratch-3.0 for kids programming
BrahimRabbani
 
PPTX
Coding scratch
FatimaAmin26
 
PDF
Scratchjr reference-page
noorishamirsyad
 
PDF
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
LaurenMichelle11
 
Scratch programming introduction to game creation
Ankita Shirke
 
Scratch for kids syllabus for 5 hours by bibek pandit
BibekPandit2
 
How do I learn to code with Scratch in AEP
socalternativeeducat
 
Scratch Lesson 1 – Basics
David Oromaner
 
Getting-Started-With-Scratch-3.0 for kids programming
BrahimRabbani
 
Coding scratch
FatimaAmin26
 
Scratchjr reference-page
noorishamirsyad
 
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
LaurenMichelle11
 

Similar to 7.Advanced Scripts in Scratch.pptx (20)

PPTX
Scratch an Editing App
CHARANJEET SIDHU
 
DOCX
ontents · Introduction· Objectives·.docx
cherishwinsland
 
PPTX
Coding scratch n
FatimaAmin26
 
PPTX
Coding scratch n
FatimaAmin26
 
PDF
Quick Step by Step Flash Tutorial
Su Yuen Chin
 
PDF
Writtten work-Answer key.pdf
ssuser7d5789
 
PDF
Flash
Deepika suren
 
PDF
Star logo nova code cookbook
Barbara M. King
 
PDF
Star logo nova code cookbook(1)
Barbara M. King
 
PDF
Scratch referenceguide14
Rene Torres Visso
 
PPT
Introduction to Scratch Programming
StorytimeSteph
 
PDF
Scratch_Reference_Guide.pdf
Muhammad Waqas, MBA-Finance, MEF
 
PPTX
Coding scratch
FatimaAmin26
 
PDF
dr_4
tutorialsruby
 
PDF
dr_4
tutorialsruby
 
PPTX
MODULE Class Animation and Flash for classroom teaching
CSGAMER2
 
DOCX
Work flow
Shaz Riches
 
DOCX
Work flow the pain is reel
Shaz Riches
 
PPT
basic of photoshop for bachelor students.ppt
rmn1212
 
PPTX
Lecture 1.pptx
afsheenfaiq2
 
Scratch an Editing App
CHARANJEET SIDHU
 
ontents · Introduction· Objectives·.docx
cherishwinsland
 
Coding scratch n
FatimaAmin26
 
Coding scratch n
FatimaAmin26
 
Quick Step by Step Flash Tutorial
Su Yuen Chin
 
Writtten work-Answer key.pdf
ssuser7d5789
 
Star logo nova code cookbook
Barbara M. King
 
Star logo nova code cookbook(1)
Barbara M. King
 
Scratch referenceguide14
Rene Torres Visso
 
Introduction to Scratch Programming
StorytimeSteph
 
Scratch_Reference_Guide.pdf
Muhammad Waqas, MBA-Finance, MEF
 
Coding scratch
FatimaAmin26
 
MODULE Class Animation and Flash for classroom teaching
CSGAMER2
 
Work flow
Shaz Riches
 
Work flow the pain is reel
Shaz Riches
 
basic of photoshop for bachelor students.ppt
rmn1212
 
Lecture 1.pptx
afsheenfaiq2
 
Ad

Recently uploaded (20)

PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
CDH. pptx
AneetaSharma15
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Virus sequence retrieval from NCBI database
yamunaK13
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Ad

7.Advanced Scripts in Scratch.pptx

  • 2. Table of contents 1 4 2 5 3 6 Creating accustom sprite and backdrop Drawing and painting tools Creating a costume or a sprite Changing the size of a sprite Applying image effects on a sprite AdvancedScripts in Scratch
  • 3. Table of contents 7 8 11 9 12 Using Sound Blocks Accepting Inputs from the User Sensing blocks Position oaf Sprite Using Variable Blocks Creating variables Using Control blocks 10
  • 5. What is Scratch ?? JavaScript-based codebase made up of multiple components such as "Scratch-GUI," now based on a library from Blackly, "Scratch-VM," which interprets code, and "Scratch-Render," the rendering engine. The Scratch Blocks are made using Blackly.
  • 6. Advanced Scripts in Scratch You have already learnt to animate sprite using the Motion, Looks and Sound blocks in Scratch. You have also learnt to add sprite ,delete aspriteand control the position of sprites. Let’s see the working of the following script to recall some of the script blocks....
  • 8. You can draw your own sprites (pictures or text) using the Scratch Paint editor. Sprite Click the Paint option in the ‘Sprite’ section to open the Scratch Paint editor. Here, you can draw your sprite using the drawing and painting tools. Follow the image.. Sprite gallery
  • 9. Create anything with scratch Show your creativity ....
  • 11. Tools  Select: The Select tool is used to select an are a on the canvas and re locate ,stretcher compress it or modify it. Circle : The circle tool is used to draw ovals or perfect circles.  Reshape : This tool is used for bending or changing the shapes of a sprite. Rectangle: The rectangle tool is used to create rectangles .Click and drag the mouse to draw a rectangle.  Brush : The Brush tool is used for free hand drawing by clicking on and dragging the mouse pointer. You can change the colour and size of the brush.  Eraser : The eraser tool is used to remove (or erase) a part of the drawing.  Fill : The paint bucket or fill tool is used to fill colours only in closed objects. You cannot fill the background with the paint bucket. Text : The text tool is used to type letters and numbers on to the canvas .to type, click anywhere on the canvas and start typing when cursor appears Line : The line tool is used for drawing lines. To draw line, press and hold the left mouse button at the starting point ,then drag and release I tat Then ding point.
  • 14. ● You can then use an aback drop for you scratch project. ● The Looks category has blocks, using which you can set or change the backdrop. ● The given script can be used to display a different back drop one by one, from the list of back drops.
  • 16. Changing the size of a sprite 5 Changing the size of as prate makes it bigger or smaller. You can change the size of as prate by using the 'set size 'block in the Looks category. You can use this feature to show a growing or shrinking sprite in an animation origami. There are two blocks available for this, 'set size ’and ‘change size’ .Set size will set the sprite to a specific size ,while change size will change its sizably specific amount
  • 18. Using Control blocks 6 Control blocks are used to control the way scripts execute. Scratch 3 has the following basic Control blocks.
  • 19. The script held inside this block will be executed in a loop for a specified number of times, before allowing the remaining script to continue. This block can be used to execute the same script repeatedly. For example, in the adjacent script, the repeat block is used to change the costume of the sprite after every 5 seconds. It will repeat this 10 times before coming to a stop.
  • 20. Using SoundBlocks 7 . We know that sound can be played by using Sound blocks in Scratch. The blocks available in this category can be used to control the volume, tempo and other features of the sound being played. Sounds can be added in Scratch by importing sound files or recording a new sound. The given script will play the sound ‘Meow’ 5 times, and gradually decrease the volume each time.
  • 21. . Note that before executing the above script once again, you need to run the block to set the volume to its full value. Uploadsound Surprise Record Choose a sound We can add new sounds by using the following options •Upload Sound – to uploada soundfile that is stored on your computer. •Surprise – to add arandom soundfile from the library. •Record – to record your own sound • Choose a sound –to choose a sound from the library
  • 22. Let use the different image effects on a sprite. backdrops. You also learnt how to execute scripts repetitively using control blocks and applied special effects to sprites. Let’s see the following script and recall some of the blocks that we have used. Assuming that the given script is created for the Ballerina sprite, the output will show the dancing Ballerina.
  • 24. . O9:Accepting Inputs from the User Sensing blocks This category contains the blocks that are used to accept inputs from the user/ keyboard. It displays an input box and prompts the user to type the input. The input entered by the user is stored in the variable. Let’s see the following script using the Sensing blocks. When the green flag is clicked, the sprite will ask for ‘What’s your name?’ and wait for an answer. Once the user enters an answer and clicks on the blue check mark, the sprite will display the entered name for 5 seconds.
  • 26. 7 . Position of a Sprite X and Y co-ordinates .
  • 27. CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik The stage in Scratch can be divided into four squares using a horizontal and a vertical line. The four squares thus formed are called quadrants. The horizontal line represents the X-axis and the vertical line represents the Y- axis. The ’ x’ position determines the horizontal location of the sprite and ‘y’ position determines the vertical location of the sprite. The point at which the X and Y-axis meet is called the origin. The value of x and y at origin is zero. origi
  • 28. CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik The value of x position of a sprite increases from 0 to 240 when it moves to the right from the origin and decreases from 0 to -240 when the sprite moves to the left from the origin. Similarly, the value of y position of a sprite increases from 0 to 180 when it moves up from origin and it decreases from 0 to -180 when the sprite moves down from the origin. x-y
  • 29. You Can Show The Above Background On The Stage By Adding The Xy-grid From The List Of Backdrops. The Position Of A Sprite On The Stage Is Decided By The Values Of Its X And Y Coordinates. If On Edge, Bounce While Moving A Sprite On The Stage It Can Happen That The Sprite Might Go Beyond The Boundaries Of The Stage And Disappear. To Avoid This, We Can Use The If On Edge, Bounce Block. This Block Checks To See If The Sprite Is Touching The Edges Of The Stage, And If It Does, It Will Make The Sprite Turn Back In The Opposite Direction. In The Following Script, The Fish Moves 10 Steps And Waits For 0.05 Seconds. When It Reaches The Edge Of The Stage, It Will Change Its Direction Instead Of Going Beyond The Stage Boundary. Note That The Set Rotation Style Left-right Block Has Been Added To Avoid The Sprite From Rotating Vertically.
  • 30. CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik
  • 31. 8 . Using Variable Blocks . While creating scripts or programs, we often need to use variables to store values. A variable is a placeholder for some value, similar to the x and y variables in Algebra. In Scratch, variables can be uniquely labelled by you. They can be used by just one sprite or by all of your sprites.
  • 34. . Step 1: Select the Variable block. Step 2: Click on Make a variable. Step 3: Specify the name of the variable and click OK. Step 4: The name of the new variable appears with a check box before it. You can now see the blocks associated with the variable.