Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
32 views
11 pages
DocScanner 3 Mar 2024 6-48 PM
Uploaded by
ritesh
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save DocScanner 3 Mar 2024 6-48 pm For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
32 views
11 pages
DocScanner 3 Mar 2024 6-48 PM
Uploaded by
ritesh
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save DocScanner 3 Mar 2024 6-48 pm For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save DocScanner 3 Mar 2024 6-48 pm For Later
You are on page 1
/ 11
Search
Fullscreen
= Let’s Learn sing a script > to accept inputs from the user U: e the position of a sprite on stat SF > to determin > touse variables in a script ate advanced scripts u sing nested loops > to cre rites and backdrops: You ied 0 create and use your own spi ntrol blocks and apP u learnt t w to execute scripts repetitively using co! a ath Last year, YO so learnt ho al ffects to sprites. special eLet's see the following Script and recall some Of the blocks that we have used, Assuming that the given Script ji will show the dancing Ballerina, $x% K Accepting Inputs from the User Sensing blocks S Created for the Ballerina sprite, the Output ete) This category contains the blocks thai keyboard. ROE 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. tare used to accept inputs from the user/ G9 What's your name? )atniten| LU atc e Oa m Op e ETM Aes} When the green flag is clicked, the sprite will ask for ‘What's your name?” = Malt for an answer. Once the user enters an answer and clicks on the blue chee i the Sprite will display the entered name for 5 seconds. a Mar| Learning by doing Use the Sensing, Events and Looks blocks to input your favourite colour. Use a sprite to display your favourite colour. The script should also change the colour of the sprite to the same colour. Position of a Sprite X and Y co-ordinates 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. X=-240 Y= 180 xe-240 x=240 Ye -180 Ye +180 The value of x position of a sprite increases from 0 to 240 when it moves to the right from * he origin and decreases from 0 to -240 when the sprite moves t©the left from the origin, Similarly, the value of from 0 to 180 when it MOVEs up from Origin ar Tom the origin, Y Position of a sprite increases it ind it decreases from 0 to -18 when the sprite Moves down fj lecre: 0 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.n the stage it can happen that the sprite might f the stage and disappear. To avoid this, we can 2 se If on edge, bounce While moving @ sprite oO beyond the boundaries 0} the If on edge, bounce block. This block checks to see if the sprite is touching the edges of the stage, ang 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 insteaq 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. a1 ees Dfeitars a vetia) eR ass ater id i Script Output of script Using Variable Blocks While creating scripts or programs, we often need to use vari bles to store values. A variable is a placeholder for some value, similar to th Nar er iables in Algebra. In Scratch, variables can be uniquely labelled by ena n be used by just one sprite or by all of your sprites. You, they © a"Ril See the Smeciiet grate ste Seer Sot cr mune: “The bie wil Same ger arreunt, socheas Stet or tre save: Rhices the Swecfiet arate tomthe Creating coh © Step 1: Select the Variables Vanes Sek Step 2: Click om Make 2 variable |” wena Step 3 Specify the name of the variabie ard dick AK Step 4: The name of the new variable BOIS WIRD F Prat Ran Pare ’t: : bs an} Can now see the blocks associated with the varatie,| | ou ni vari ow or hide its value on the Stag eck the variable to s| hid You can check and unch hi Assigning values to a variable / Use the set script block from the Variables group to assign values to the variable. Gea Whats your name? Jeno | | ° | Script Output | Changing the value of a variable Let's create a game in which you have to click on each fruit to put it in the bowl. Each time a fruit is placed inside the bowl, the score increases by 1. Create a new Scratch project and import the Bowl sprite. Create a new variable called score and add the following script. catsroro GD The given script increases the size of the bowl by 400%. It Positions the sprite at the specified location and also assigns an initial value of 0 to the variable score.ing scripts to it. id the sprite Strawberry from the library and add eee ita ‘he s first script puts the strawberry in the basket when it is clicked. W s clicked, the strawberry goes back to its starting position. green flag wrx @y @| Add the sprite Orange from the library and add the following scripts fort | @ When the green flag is clicked, each fruit will be placed at th in its script. The user has to click on each fruit to place it in tl the ‘score’ variable will show the final score. re € Position SPecifieg he bowl, Atthe end, WR 3 ton | G-ede | Using nested loops In Programming, a nested loo; P refers toa looping structure forever block used inside anot such as a repeat or ther looping structure,F Word Galaxy ee. input variable nested quadrant Mind Map ask and walt blk ‘accepting input from the user ‘Advanced Features of Scratch 3 X and ¥ co-erdinates creating variables position of the Sprite ing values “near if on edge, bounce ing the value “Tice aE & QL. Tick the correct option. a Itrefers toa looping structure such as a another looping structure. Nested loop ii, input block repeat or forever block used inside ili, answer block & The block Category used for acce ting input from the user, "Looks ii, Sensing ili. Motion : i Stores the most recent keyboard input. "Value ii input ii, answer * What is need for variables i in Scratch? Explain with an example.What will be the output of the adjacent script assuming that you have created new variable runs = 0. QL. Writea script in Scratch to in; the keyboard and display it. Q.2. Create two variables - fruit and vegetable. Write a Script in s, to input your favourite fruit and vegetable, variables. Display the values entered. put your favourite sports Person usin cratch and save the result in the 2 » Create a game in Scratch where game should keep a score for tl display it at the end of the game. you have to burst a balloon, The he number of balloons burst and Add 10 different ‘balloon’ sprites on stage from the library. When a balloon is clicked, it should burst. Use a different costume to show the same and then make it disappear from stage. * Create a variable ‘score’. When a balloon is burst, the score should increase by 1. * _ Display the final score when all balloons have burst. Q4. Create a geometric Pattern using the nested loops. HOTS You know that the block changes the value of the specified variable by a given value. Find out what will happen if the value of the variable is a text value? Web Links httpsy//scratch.mit.edu/projects/editor/?tutorial=getStarted As on 09.08.2019
You might also like
Class-5 Computer-Gaming in Scratch (Notes)
PDF
No ratings yet
Class-5 Computer-Gaming in Scratch (Notes)
5 pages
101 Effective Scratch Questions
PDF
No ratings yet
101 Effective Scratch Questions
131 pages
Scratch Basics
PDF
100% (3)
Scratch Basics
36 pages
Grade 6 Computer Science
PDF
No ratings yet
Grade 6 Computer Science
4 pages
Block Programming - Full
PDF
No ratings yet
Block Programming - Full
50 pages
Programming in Scratch
PDF
No ratings yet
Programming in Scratch
69 pages
Section 2 - The Basics of Block - Based Computer Programming
PDF
No ratings yet
Section 2 - The Basics of Block - Based Computer Programming
66 pages
Bourret ScratchProgramming
PDF
100% (1)
Bourret ScratchProgramming
43 pages
Introduction To Scratch
PDF
100% (1)
Introduction To Scratch
67 pages
Scratch Programming (Scratch 3.0)
PDF
No ratings yet
Scratch Programming (Scratch 3.0)
13 pages
Scratch
PDF
No ratings yet
Scratch
17 pages
Scratch Tutorial
PDF
No ratings yet
Scratch Tutorial
10 pages
1 Scratch Introduction
PDF
No ratings yet
1 Scratch Introduction
20 pages
ScratchLearningResource VariablesandLists
PDF
No ratings yet
ScratchLearningResource VariablesandLists
9 pages
SCRATCH PROGRAMMING ch-1
PDF
No ratings yet
SCRATCH PROGRAMMING ch-1
24 pages
CAIE - VI - Computer Studies - More Features of Scratch
PDF
No ratings yet
CAIE - VI - Computer Studies - More Features of Scratch
17 pages
Scratch Programming Lower Primary - Year 5&6 - Copy - 1741958593
PDF
No ratings yet
Scratch Programming Lower Primary - Year 5&6 - Copy - 1741958593
40 pages
Advanced Programming With Scratch
PDF
No ratings yet
Advanced Programming With Scratch
48 pages
A.all Blocks of Scratch 0
PDF
No ratings yet
A.all Blocks of Scratch 0
10 pages
Scratch P2 New Eng
PDF
No ratings yet
Scratch P2 New Eng
45 pages
Coding
PDF
No ratings yet
Coding
13 pages
5.advanced Scripts in Scratch
PDF
No ratings yet
5.advanced Scripts in Scratch
36 pages
CSC - Prog in Scratch
PDF
No ratings yet
CSC - Prog in Scratch
12 pages
Programming With Scratch
PDF
No ratings yet
Programming With Scratch
77 pages
Lecture 1 - Introduction To Scratch
PDF
No ratings yet
Lecture 1 - Introduction To Scratch
21 pages
Grade 6-8 Dec
PDF
No ratings yet
Grade 6-8 Dec
51 pages
JULY-AUGUST - Scratch Tutorial - Exploring Programming Concepts
PDF
No ratings yet
JULY-AUGUST - Scratch Tutorial - Exploring Programming Concepts
11 pages
JuanPablo ProgrammingActivities
PDF
No ratings yet
JuanPablo ProgrammingActivities
112 pages
HKICO Scratch Ver3
PDF
No ratings yet
HKICO Scratch Ver3
26 pages
Additional Questions
PDF
No ratings yet
Additional Questions
2 pages
An Introduction To Programming With Scratch: Ronald Bourret
PDF
No ratings yet
An Introduction To Programming With Scratch: Ronald Bourret
43 pages
1 Scratch
PDF
No ratings yet
1 Scratch
67 pages
MSTBlockAFunWayofProgramming 224028
PDF
No ratings yet
MSTBlockAFunWayofProgramming 224028
17 pages
1 Introduction
PDF
No ratings yet
1 Introduction
20 pages
HKICO Scratch
PDF
No ratings yet
HKICO Scratch
25 pages
Scratch Introduction
PDF
No ratings yet
Scratch Introduction
37 pages
Intr CompSci With Scratch Workbook
PDF
No ratings yet
Intr CompSci With Scratch Workbook
28 pages
Scratch Programming
PDF
No ratings yet
Scratch Programming
20 pages
Anon YYYY Learning Outcomes For Scratch-Based Curriculum
PDF
No ratings yet
Anon YYYY Learning Outcomes For Scratch-Based Curriculum
41 pages
SE-1001Lab01 Fall 2023
PDF
No ratings yet
SE-1001Lab01 Fall 2023
5 pages
An Introduction To Programming With Scratch
PDF
No ratings yet
An Introduction To Programming With Scratch
30 pages
This Sprite Needs You
PDF
No ratings yet
This Sprite Needs You
51 pages
Second Term Revision Worksheet - Answers
PDF
No ratings yet
Second Term Revision Worksheet - Answers
9 pages
Motion Blocks
PDF
No ratings yet
Motion Blocks
4 pages
S3 Scratch Programming: ST Louis School
PDF
No ratings yet
S3 Scratch Programming: ST Louis School
98 pages
Scratch
PDF
No ratings yet
Scratch
7 pages
Oxford University Press: Visual Programming Through Scratch
PDF
No ratings yet
Oxford University Press: Visual Programming Through Scratch
22 pages
Introduction To Scratch 1
PDF
No ratings yet
Introduction To Scratch 1
3 pages
By Ob Manual
PDF
No ratings yet
By Ob Manual
23 pages
Back Exercise
PDF
No ratings yet
Back Exercise
4 pages
Aiv Img
PDF
No ratings yet
Aiv Img
5 pages
8a. Scratch-3.0-for-Inclusive-Learning
PDF
No ratings yet
8a. Scratch-3.0-for-Inclusive-Learning
31 pages
Coding: Programming Languages
PDF
No ratings yet
Coding: Programming Languages
14 pages
ITC LAB 6 - Scratch + Algorithms
PDF
No ratings yet
ITC LAB 6 - Scratch + Algorithms
7 pages
Daily Learning Activity: Subject
PDF
No ratings yet
Daily Learning Activity: Subject
2 pages
BYOB Reference Manual
PDF
No ratings yet
BYOB Reference Manual
26 pages