Presentation is loading. Please wait.

Presentation is loading. Please wait.

Subject : Computers Chapter-7

Similar presentations


Presentation on theme: "Subject : Computers Chapter-7"— Presentation transcript:

1 Subject : Computers Chapter-7
Topic: Scratch

2 Let’s Learn Date:01/04/2020 Scratch interface Control blocks
Broadcast and receive messages Stage interface Directions and coordinates of the stage

3 A programming language where users can design/ create interactive stories, animations and games.

4 Scratch Interface

5 How to create a new sprite
Click on any one of the options to create a sprite. Choose sprite from library Upload sprite from file Paint new sprite New sprite from camera A sprite can be uploaded from library, file or camera.

6 This sprite is chosen from the sprite library.
Right click on the sprite to create a duplicate or delete it.

7 Tools to design a sprite
With the help of drawing and Painting tool, a sprite can be designed.

8 Sample of two different costumes
Four different costumes

9 For Animating a Sprite Click the Script tab and select the control group. 2. Drag out the forever script block and drop it in the script editor. 3. Click the look group. Drag out the ‘next costume’ block and drop it inside the ‘forever’ block to form a combination block.

10 To add a gap between changing the costumes, a control block ‘wait 1 sec’ can be added.
Add the ‘When clicked’ script block so that the script starts when the ‘green flag’ is clicked.

11 Examples 1. 2. 3.

12 Adding sound to the sprite
1. 2. The sprite will change it’s costume in the gap of 1 sec while the Pop sound is playing in the background till the stop button is clicked. The sprite will change it’s costume by the gap of 1 sec. The background sound will play until the script is playing. The entire script will be repeated 10 times.

13 Stage The stage is divided into four squares by a horizontal line and a vertical line. The four squares formed are called the quadrants. Each point on the stage is represented by two numbers called ‘X’ and ‘Y’ values.

14 Stage Interface Y-axis X-axis

15 Stage The horizontal line is labeled as x- axis and the vertical line is labeled as the y-axis. The point at which the x axis and y axis meet is called the origin.

16

17 It is used to control the multiple execution of scripts.
Control Block It is used to control the multiple execution of scripts.

18 BROADCAST BLOCK Broadcast is a way to make a sprite or background to send a message to all other sprites.

19 Types of Broadcast blocks

20 Receive Block It allows to receive the message broadcasted by it to sprite.

21 Broadcast and Receive Block
Every time you click on the cat, the bat will change its colour shade.

22 Change Background  First, you will need to create or import two backgrounds in Scratch.

23 The script goes like this in stage script area.

24 Change Background contd…
The scripts in the previous slides: Reset the background to background1 at the start. Broadcast either Go to 1 or Go to 2, depending on what key is pressed. The script checks which message is broadcast and changes the backdrop appearance.

25 LINKING SPRITE AND BACKGROUND SCRIPTS
Using the same two sprites, link each sprite to a different background. For example, when the cat is clicked, get the stage to change into a bedroom. When the bat is clicked, get the stage to change into forest.

26 New broadcasts added to the stack

27 Backdrop script (in Stage script area)

28 Date:-01/04/ Home work Write Script/Action break with solution given on page no-149,151 in computer notebook As shown below example Ex: The sprite will move 100 steps when this command will be executed. Move 100 steps

29 Let's Learn To identify the use of ask and wait To use variables

30 Variables A variable is like a container which can store different objects at different times. Values stored in variables can change.

31 Variable Variables are created to store values.

32 ask and wait block The ask and wait block provided in the Sensing category allows us to ask a question and wait for the input typed by the user.

33 'answer' Variable The input given by the user is stored in the predefined Scratch variable called answer. To see the value stored in the answer variable check the answer checkbox in the Sensing category. You can now see the value stored in answer on the stage.

34 Few games which needs human interaction…….

35 Variables The Variable category allows you to create variables and use them in a program. A variable can store numbers and strings. Letters, words and sentences are called strings. Numbers are formed by digits and can be used in calculations.

36 Steps to create variables
1 3 2

37 A variable for all sprites (a global variable) can be seen, changed and used by any sprite. Other sprites can see its value, using the [x position of Sprite 1] Sensing block, but they can't change it. A variable for this sprite only (a local variable) change values for a particular sprite. A variable for one sprite belongs to that sprite alone

38 set variable name script block to assign a value to the variable
Assign values set variable name script block to assign a value to the variable

39 Changing the value of a variable

40 Date:- 25/03/2020 Hand on !!!


Download ppt "Subject : Computers Chapter-7"

Similar presentations


Ads by Google