Zmiany

Skocz do: nawigacji, wyszukiwania
/* Operators */
Scratch is a scripting, visual programming language. We use it to build scripts by putting together blocks representing commands, control instructions, expressions, etc. The version 2.0 set of blocks is divided into 10 categories (there were 8 categories in version 1.4), blocks in each category are distinguished by a different colour. This glossary is not a description of all the blocks, only the most important ones as well as those used in scenarios of classes designed for students in grades four to six of primary schools developed as part of the “Masters of Coding” project. Version 2.0 introduces a very important '''More blocks''' category which allows users to define their own blocks. It is not described in this document, because the first eight scenarios do not expect users to create their own blocks. This category will be described in future scenarios. Each sprite and stage may have their own scripts. The set of blocks from which you can build scripts for a stage is slightly different than that used for sprites, for example the category '''Motion''' for the stage is empty, because the stage cannot be moved or rotated. First, we will discuss various types of blocks for sprites, and then basic information about blocks available for the stage will be provided.<br />
==MOTIONMotion==
[[Plik:M_3_1.JPG|center]]
The category '''Motion ''' groups sprite movement blocks, used for their movement, rotation and reading current data related to a sprite’s location. These are very often used basic blocks. Below is a description of all the blocks in this category.
[[Plik:M_3_2.JPG]]
[[Plik:M_3_24.JPG|center]]
The '''Looks ''' category is a collection of sprite appearance blocks concerning costume, size, visibility, etc. Some of these blocks are used very often. Below is a description of most blocks in this category.
[[Plik:M_3_25.JPG]]
For a limited time displays in a speech bubble the text shown in the edit box. This means stopping the script execution for a specified number of seconds. A variable can also be 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_26.JPG]]
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]]
For a limited time displays in a thought bubble the text shown in the edit box. This means stopping the script execution for a specified number of seconds. It works in the same way as the '''say ''' command, but a different kind of information is displayed. A variable can also be 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_28.JPG]]
Displays in a thought bubble the text shown in the edit box and does not stop the script execution. Consequently, further instructions are executed, which might cause the information’s quick disappearance. It works in the same way as the '''say ''' command, it is just a different kind of bubble. A variable can also be 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_39.JPG]]
Name of the currently displayed background. It can be used as an argument in expressions.
Checking the checkbox on the left displays the background name on the stage.
[[Plik:M_3_45.JPG]]
Stops all currently played sounds.
==Pen==
[[Plik:M_3_76.JPG]]
This block allows us to define and broadcast a message. We can choose the message name from the drop-down list or define a new message using the '''new message... ''' option available when we expand the list.
[[Plik:M_3_77.JPG]]
[[Plik:M_3_109.JPG]]
The blocks used to build complex logical expressions (conjunction – both conditions are true, alternative – one of the conditions is true, negation – contradiction). Insert the matching blocks returning Boolean values (true or false) in argument boxes. Blocks are used most often in the following instructions: '''if, repeat until, wait until'''.
'''Example:'''
[[Plik:M_3_110.JPG]]
The block is used to connect two strings of text into one. Usually one of the arguments is the entered text, and the other a value returned by another block. The block is often used as an argument in the '''say ''' and '''think ''' blocks.
'''Example:'''
223
edycje