Scratch - Bloky

  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc on line 13.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_field_user::init() should be compatible with views_handler_field::init(&$view, $options) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/modules/user/views_handler_field_user.inc on line 47.
  • strict warning: Declaration of views_handler_field_node_new_comments::pre_render() should be compatible with views_handler_field::pre_render($values) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/modules/comment/views_handler_field_node_new_comments.inc on line 100.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
  • strict warning: Non-static method view::load() should not be called statically in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of date_handler_field_multiple::pre_render() should be compatible with content_handler_field_multiple::pre_render($values) in /var/www/virtual/mrazovci.eu/htdocs/sites/all/modules/date/date/date_handler_field_multiple.inc on line 185.
Verzia pre tlačSend by emailPDF verzia

TYPES OF BLOCKS

There are three main types of blocks in the Blocks Palette:
Stack Blocks: These blocks have bumps on the bottom and/or notches on the top, such as Hide.gif. You can snap these blocks together into stacks. Some stack blocks have an input area inside them, where you can type a number (such as 10 in the move10steps.gifblock) or choose an item from a pull-down menu (such as pop in the Play_Sound.gif block). Some stack blocks, such as Forever_If.gif, have a C-shaped “mouth” where you can insert other stack blocks.

Hats: These blocks have rounded tops, such as When_Key_Pressed.gif. These blocks are placed at the tops of stacks. They wait for an event to happen, such as a key being pressed, then run the blocks underneath them.

Reporters: These blocks, such as xposition.gif  and Mouse_Down.gif, are designed to fit in the input area of other blocks. Reporters with rounded ends (such as xposition.gif or variable.gif) report numbers or strings, and fit in blocks with rounded or rectangular holes (such as Set_Size_To_100.gif or Say_Hello.gif). Reporters with pointed ends (such as  Mouse_Down.gif) report boolean values (true or false) and fit inside blocks with pointed or rectangular holes (such as Wait_Until.gif or Say_Hello.gif).

Click on any reporter block to see its current value.

Some reporter blocks have a check box next to them, such as X_Position.gif. If you click in the check box, a monitor appears on the stage, displaying the current value of the reporter. As the value of the reporter changes, the monitor updates automatically. A monitor can display the value of the reporter in several different formats:

Monitor_Small.gif a small readout with the name of the reporter
Monitor_Large.gif a large readout without any name
Monitor_Slider.gif a slider that allows you to manipulate the value of the reporter (available only for variables)

Double-click or right-click (Mac: Ctrl+click) on a monitor to change from one format to another.

The slider format is available only for user-created variables. Right-click (Mac: Ctrl+click) on the monitor in slider format to adjust its minimum and maximum values.

LISTS

You can create and manipulate lists in Scratch.  Lists can store numbers as well as strings of letters and other characters. 

To create a list, go to the Variables blocks category and click Make_List.gif. Once you make a list, several list blocks will appear. The list blocks are described in the Block Descriptions section of this guide.

When you create a list, a list monitor will appear on the stage. A list monitor shows all the items in a given list. You can type items directly into a list monitor. 

At first the list will be empty, with length 0.  To add to the list, click the + button on the bottom left of the list monitor. The length will increase by 1. Alternatively, you can add to the list using the list blocks (e.g., add_string_list_example.gif).

You can resize the list monitor from the bottom right-hand corner.

Note: You can right-click (Mac: Ctrl+click) on a list monitor to export a  list to a plain .txt file.  You can also import any saved plain .txt files with values on separate lines.

STRINGS

Strings are made of letters, words, or other characters (e.g., apple; October 2009; You win!).

Strings can be stored in variables or lists (such as set_variable_example.gif or  add_string_list_example.gif).

You can join together strings using JoinBlock.gif. You can compare strings using the following blocks: Equal_To.gifLess_Than.gif, or  Greater_Than.gif.

Strings are evaluated as 0 in mathematical operation blocks (such as: Add.gif) and in blocks that expect a number (such as move10steps.gifand  Change_Pen_Size_By_1.gif). 

KEYBOARD INPUT

You can use AskBlock.gif to prompt a user to type in a response on the keyboard. The response is stored in AnswerBlock.gif. The question appears on the screen and the program waits until the Enter key is pressed or the check mark is clicked.

AskScreen.gif
AskScreenStage.gif
The question appears in a voice balloon when used in a sprite. The question appears at the bottom of the screen when used in the Stage.

AnswerBlock.gif is shared by all sprites (global) and is replaced each time AskBlock.gif runs. If you want to save the current AnswerBlock.gif, you can store it in a variable or list.  

BLOCK DESCRIPTIONS

The Scratch blocks are organized into eight color-coded categories: Motion, Looks, Sound, Pen, Control, Sensing, Operators, and Variables.

Motion

move10steps.gifMoves sprite forward or backward.

Turn_15_Degrees.gif Rotates sprite clockwise.

Turn_15_Degrees_Counter.gifRotates sprite counterclockwise.

Point_In_90.gif Points sprite in the specified direction. (0=up, 90=right, 180=down, -90=left)

Point_Towards.gifPoints sprite toward mouse-pointer or another sprite.

Go_To_X_Y.gifMoves sprite to specified x and y position on Stage.

Go_To.gif Moves sprite to the location of the mouse-pointer or another sprite.

Glide_1_Secs_To_X_Y.gif Moves sprite smoothly to a specified position over specified length of time.

Change_X_By_10.gif Changes sprite's x-position by specified amount.

Set_X_to.gif Sets sprite's x-position to specified value.

Change_Y_By_10.gif Changes sprite's y-position by specified amount.

Set_Y_To.gif Sets sprite's y-position to specified value.

If_On_Edge_Bounce.gif Turns sprite in opposite direction when sprite touches edge of Stage.

X_Position.gif Reports sprite's x-position. (Ranges from -240 to 240)

Y_Position.gif Reports sprite's y-position. (Ranges from -180 to 180)

Direction.gifReports sprite's direction. (0=up, 90=right, 180=down, -90=left)

Motor Blocks

The motor blocks only appear if you choose Show Motor Blocks in the Edit menu or if you plug in a LEGO WeDo. These blocks work with a LEGO WeDo motor. (See http://www.legoeducation.com)

MotorOnFor.gif Turns motor on for specified amount of time.

MotorOn.gif Turns motor on.

MotorOff.gif Turns motor off.

MotorPower.gif Sets power of motor and turns motor on. (Ranges from 0 to 100)

MotorDirection.gif Sets direction of a motor, but does not turn the motor on. (this way =  clockwise; that way = counterclockwise; reverse = change direction)

Looks

Switch_to_Costume.gif Changes sprite's appearance by switching to different costume.

Next_Costume.gif Changes sprite's costume to next costume in the costume list. (If at end of the costume list, jumps back to first costume.)

Costume_#.gif Reports sprite's current costume number.

Switch_to_Background.gif Changes Stage's appearance by switching to a different background.

Next_Background.gif Changes Stage's background to next background in the background list.

Background_#.gif Reports Stage's current background number.

Say_Hello_For_2_Secs.gif Displays sprite's speech bubble for specified amount of time.

Say_Hello.gif Displays sprite's speech bubble. (You can remove speech bubble by running this block without any text.)

Think_Hmm_For_2_Secs.gif Displays sprite's thought bubble for specified amount of time.

Think_Hmm.gif Displays sprite's thought bubble.

Change_Color_Effect_By_25.gif Changes a visual effect on a sprite by specified amount. (Use pull-down menu to choose effect.)

Set_Color_Effect_To_0.gif Sets a visual effect to a given number. (Most visual effects range from 0 to 100.)

Clear_Graphic_Effects.gif Clears all graphic effects for a sprite.

Change_Size_By_10.gif Changes sprite's size by specified amount.

Set_Size_To_100.gif Sets sprite's size to specified % of original size.

Size.gif Reports sprite's size, as % of original size.

Show.gif Makes sprite appear on the Stage.

Hide1.gif Makes sprite disappear from the Stage. (When sprite is hidden, other sprites cannot detect it with the touching? block.)

Go_To_Front.gif Moves sprite in front of all other sprites.

Go_Back.gif Moves sprite back a specified number of layers, so that it can be hidden behind other sprites.

Sound

Play_Sound1.gif Starts playing a sound, selected from pull-down menu, and immediately goes on to the next block even as sound is still playing.

Play_Sound_Until_Done.gif Plays a sound and waits until the sound is finished playing before continuing with next block.

Stop_All_Sounds.gif Stops playing all sounds.

Play_Drum_For_Beats.gif Plays a drum sound, selected from pull-down menu, for specified number of beats.

Play_Note_For_Beats_with_Piano.gif Plays a musical note (higher numbers for higher pitches) for specified number of beats.

Rest_for.gif Rests (plays nothing) for specified number of beats.

Set_Instrument_To.gif Sets the type of instrument that the sprite uses for play note blocks. (Each sprite has its own instrument.)

ChangeVolumeBy.gif Changes sprite's sound volume by specified amount. Volume ranges from 0 to 100.

SetVolume.gif Sets sprite's sound volume to specified value.

Volume.gif Reports sprite's sound volume.

ChangeTempoBy.gif Changes sprite's tempo by specified amount.

Set_Tempo_to_BPM.gif Sets sprite's tempo to specified value in beats per minute.

Tempo.gif Reports sprite's tempo in beats per minute.

Pen

Clear.gif Clears all pen marks and stamps from the Stage.

Pen_Down.gif Puts down sprite's pen, so it will draw as it moves.

Pen_Up.gif Pulls up sprite's pen, so it won't draw as it moves.

Set_Pen_Color_To.gif Sets pen's color, based on choice from color picker.

Change_Pen_Color_By.gif Changes pen's color by specified amount.

Set_Pen_Color_To_0.gif Sets pen's color to specified value. (pen-color=0 at red end of rainbow, pen-color=100 at blue end of rainbow)

Change_Pen_Shade_By.gif Changes pen's shade by specified amount.

Set_Pen_Shade_To.gif Sets pen's shade to specified amount. (pen-shade=0 is very dark, pen-shade=100 is very light)

Change_Pen_Size_By_1.gif Changes pen's thickness.

Set_Pen_Size_To_1.gif Sets pen's thickness.

Stamp.gif Stamps sprite's image onto the Stage.

Control

WhenGreenFlag.gif Runs script below when green flag is clicked.

When_Key_Pressed.gif Runs script below when specified key is pressed.

When_Sprite1_Clicked.gif Runs script below when sprite is clicked.

Wait_1_Secs.gif Waits specified number of seconds, then continues with next block.

Forever.gif Runs the blocks inside over and over.

Repeat_10.gif Runs the blocks inside a specified number of times.

Broadcast_And_Wait.gif Sends a message to all sprites, triggering them to do something, and waits until they all finish before continuing with next block.

Broadcast.gifSends a message to all sprites, then continues with the next block without waiting for the triggered scripts.

When_I_Receive.gif Runs script below when it receives specified broadcast message.

Forever_If.gif Continually checks whether condition is true; whenever it is, runs the blocks inside.

If.gif If condition is true, runs the blocks inside.

If_Else.gif If condition is true, runs the blocks inside the if portion; if not, runs the blocks inside the else portion.

Wait_Until.gif Waits until condition is true, then runs the blocks below.

Repeat_Until.gif Checks to see if condition is false; if so, runs blocks inside and checks condition again. If condition is true, goes on to the blocks that follow.

Stop_Script.gif Stops the script.

Stop_All.gif Stops all scripts in all sprites.

Sensing

Touching.gif Reports true if sprite is touching specified sprite, edge, or mouse-pointer. (Selected from pull-down menu.)

Touching_Color.gif Reports true if sprite is touching specified color. (Click on color patch, then use eyedropper to select color.)

Color_Is_Touching.gif Reports true if first color (within sprite) is touching second color (in background or another sprite). (Click on color patch, then use eyedropper to select color.)

AskBlock.gif Asks a question on the screen and stores keyboard input in the . Causes the program to wait until Enter key is pressed or check mark is clicked.

AnswerBlock.gif Reports keyboard input from the most recent use of AskBlock.gif. Shared by all sprites (global).

Mouse_x.gif Reports the x-position of mouse-pointer.

Mouse_y.gif Reports the y-position of mouse-pointer.

Mouse_Down.gif Reports true if mouse button is pressed.

Key_Space_Pressed.gif Reports true if specified key is pressed.

Distance_To.gif Reports distance from the specified sprite or mouse-pointer.

Reset_Timer.gif Sets the timer to zero.

Timer.gif Reports the value of the timer in seconds. (The timer is always running.)

Property_of_Sprite.gif Reports a property or variable of another sprite.

Loudness.gif Reports the volume (from 1 to 100) of sounds detected by the computer microphone.

Loud.gif Reports true if computer microphone detects a sound volume greater than 30 (on scale of 1 to 100).

Slider_Sensor_Value.gif Reports the value of specified sensor. To use this block, you need a  sensor connected to your computer. You can use this with a Scratch sensor board (http://www.playfulinvention.com/picoboard.html) or with LEGO® WeDo™ (http://www.legoeducation.com).

Sensor_Button_Pressed.gif Reports true if specified sensor is pressed. To use this block, you need to have a Scratch sensor board connected to your computer. (See http://www.playfulinvention.com/picoboard.html)

Operators

Add.gif Adds two numbers.

Subtract.gif Subtracts second number from first number.

Multiply.gif Multiplies two numbers.

Divide.gif Divides first number by second number.

Pick_Random_1_to_10.gif Picks a random integer within the specified range.

Less_Than.gif Reports true if first value is less than second.

Equal_To.gif Reports true if two values are equal.

Greater_Than.gif Reports true if first value is greater than second.

And.gif Reports true if both conditions are true.

Or.gif Reports true if either condition is true.

Not.gif Reports true if condition is false; reports false if condition is true.

JoinBlock.gif Concatenates (combines) strings.

length.gif Reports the number of letters in a string.

letterOf.gif Reports the letter at the specified position in a string.

Math.gif Reports result of selected function (abs, sqrt, sin, cos, tan, asin, acos, atan, ln, log, e^, 10^) applied to specified number.

Mod.gif Reports remainder from division of first number by second number.

Round.gif Reports closest integer to a number.

Variables

Make_a_variable.gif Allows you to create and name a new variable. When you create a  variable, the blocks for that variable will appear. You can choose whether the variable is for all sprites (global) or just for one sprite (local).

delete_a_variable.gif Deletes all blocks associated with a variable.

variable.gif Reports value of the variable.

Change_Score_13.gif Changes the variable by specified amount. If you have more than one variable, use the pull-down menu to select the variable name.

Score_13.gif Sets the variable to specified value.

Show_Variable.gif Shows the variable monitor on the stage.

Hide_Variable.gif Hides the variable monitor so it is not visible on the stage.

Make_List.gif Allows you to create and name a new list. When you create a list, the blocks for that list will appear. You can choose whether the list is for all sprites (global) or just for one sprite (local).

delete-a-list.gif Deletes the blocks associated with the list.

My_List_Box.gif Reports all the items in the list.

Add_to_List.gif Adds the specified item to the end of the list. The item can be a number or a string of letters and other characters.

delete-list.gif Deletes one or all items from a list. You can choose from the pull-down menu, or use a number to specify which item to delete. Choosing ?last? deletes the last item in the list. Choosing ?all? deletes everything from the list. Deleting decreases the length of the list.

insert_list.gif Inserts an item at the specified position in the list. You can choose from the pull-down menu, or use a number to specify where to insert the item. Choosing ?last? adds the item to the end of the list. Choosing ?any? inserts at a random place in the list. The length of the list increases by 1.

replace_list.gif Replaces an item in the list with the specified value. You can choose from the pull-down menu, or use a number to specify which item to replace. Choosing ?last? replaces the last item on the list. Choosing ?any? replaces a random item in the list. The length of the list does not change.

item_list.gif Reports the item at the specifed position in the list. You can choose from the pull-down menu, or use a number to specify which item to report. Choosing ?any? reports a random item in the list.

length_list.gif Reports how many items are in the list.

ListContains.gif Reports true if the list contains the specified item. (The item must match exactly to report true.)