Zmiany

Skocz do: nawigacji, wyszukiwania

Introduction 3 - Glossary of basic Scratch 2.0 blocks

Dodane 5202 bajty, 19:16, 6 lip 2015
Displays in a speech bubble the text shown in the edit box and does not stop the script execution. Consequently, further instructions are executed, which might cause the bubble’s quick disappearance. A variable can also dragged into the edit box or an expression can be built in it – often to connect the displayed information we use the join block.
 
'''Example:'''
[[Plik:M_3_27.JPG]]
[[Plik:M_3_41.JPG|center]]
 
 
 
 
 
 
 
[[Plik:M_3_42.JPG|center]]
 
The '''Sound''' category is a group of blocks for sounds, instruments and musical notes. Below is a description of audio file playback blocks only. A sprite may be connected with various sounds (assigned audio files), by default the cat sprite is assigned one sound – meow. To change sounds assigned to a given sprite (removing/adding a sound file, recording our own audio) we use the '''Sounds''' tab.
 
[[Plik:M_3_44.JPG]]
 
Plays the audio file selected from the drop-down list. The subsequent script instructions are executed independently of the audio being played.
'''Example:'''
 
[[Plik:M_3_43.JPG]]
 
Causes the audio file selected from the drop-down list to be played and pauses the script execution. Subsequent script instructions are executed after the audio file playback has finished.
 
'''Example:'''
 
[[Plik:M_3_45.JPG]]
 
Stops all currently played sounds.
 
 
 
 
 
 
 
[[Plik:M_3_46.JPG|center]]
 
The '''Pen''' category is a collection of blocks connected with a sprite’s pen, its status, colour and thickness. This group also includes a block used to clear created drawings and the possibility of copying the sprite’s image as a stamp. Below is a description of all the blocks in this category.
 
[[Plik:M_3_47.JPG]]
 
Clears the drawings created by all sprites. It has no effect on the stage background.
 
[[Plik:M_3_48.JPG]]
 
Causes the sprite image (the current costume) to be stamped as a stamp image.
 
'''Example:'''
 
[[Plik:M_3_49.JPG]]
 
Causes the pen to be applied. The movements performed will cause a drawing to be created in accordance with the pen settings (colour, thickness).
'''Example:'''
 
[[Plik:M_3_50.JPG]]
 
Causes the pen to be raised. Sprite movements will not result in the creation of a drawing. Example: See the description of the '''apply pen''' block.
 
[[Plik:M_3_51.JPG]]
 
Selects the pen colour. We should click the mouse on the box with the colour, then select a colour from the ones available using the mouse cursor. In the following example green was selected by clicking the green flag and red in the script execution stop button. Depending on the selected colour also the colour shade settings change.
Note: In version 1.4 after clicking on the colour block square the palette of colours to choose a from is also displayed. Unfortunately, now there is no such option in version 2.0.
 
'''Example:'''
 
[[Plik:M_3_52.JPG]]
 
Each colour has its numerical value. Colour numbers vary in the range of 0 to 200 by passing through the colours of the rainbow. The colour number 0 is red, 70 is green, 130 blue, and 170 crimson (magenta). This command changes the colour value by a specified argument.
 
'''Example:'''
 
[[Plik:M_3_53.JPG]]
 
Each colour has its numerical value. Colour numbers vary in the range of 0 to 200 by passing through the colours of the rainbow. The colour number 0 is red, 70 is green, 130 blue, and 170 crimson (magenta). This command sets the colour in accordance with a specified numerical value.
 
'''Example:'''
 
[[Plik:M_3_54.JPG]]
 
Each colour has a shade determined by a numerical value between 0 and 100. The shade with a value of 0 is similar to black, the shade with a value of 100 is close to white. The default value is 50. This command changes the shade value by a specified argument.
 
[[Plik:M_3_55.JPG]]
 
Each colour has a shade determined by a numerical value between 0 and 100. The shade with a value of 0 is similar to black, the shade with a value of 100 is close to white. The default value is 50. This command sets the shade value to a specified value.
 
'''Example: '''
 
[[Plik:M_3_56.JPG]]
 
This command changes the pen thickness value by a specified argument.
 
'''Example: '''
 
[[Plik:M_3_57.JPG]]
 
This command sets the pen thickness value to a specified value.
 
'''Example:'''
 
[[Plik:M_3_58.JPG]]
 
[[Plik:M_3_59.JPG|centre]]
 
The '''Data''' category contains buttons for creating variables. Once we have created our own variables, blocks will appear to be modified and use values. Variables allow us to store data. We can compare a variable to a drawer in which we hide something, we ask what is inside, we change the value. Scratch also uses variables, e.g. in the '''Motion''' category we can get the value of the coordinates of the sprite’s current position or of its direction.
 
[[Plik:M_3_60.JPG]]
 
If we have not created any variable of our own, there will be two buttons available in the Data category.
 
[[Plik:M_3_61.JPG]]
 
The second button, '''Make a list''', is used to create variables to store more complex data, which we do not use in scenarios developed for classes for students in grades four to six as part of the “Masters of Coding” programme. We will use variables only to store numerical data. After clicking on the '''Make a variable''' button a dialog box will appear on the screen, as shown below. We need to specify the variable name and select its availability – whether the variable is to be available for all sprites (also for the stage) or only for a specific sprite (in this case other sprites cannot see that variable; they can also have a variable with the same name, but these will be different variables).
223
edycje