0% found this document useful (0 votes)
65 views5 pages

Sensing Block

Uploaded by

heromoto5390
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views5 pages

Sensing Block

Uploaded by

heromoto5390
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Scratch is a free programming language developed

by MIT (Massachusetts Institute of Technology) that


makes it easy to create interactive stories, animations,
games, music, and art, and share your creations on the
web. Scratch can run in a modern web browser or be
downloaded as an app.

Sensing block In Scratch, sensing blocks are blocks


of code that allow your sprites (characters or objects in
your program) to detect and respond to their
environment. You can use sensing blocks to check the
position of your sprites on the stage, the color of a
pixel, or the distance to another sprite.
Here are some examples of sensing blocks in Scratch:
1. “Ask [question] and wait” block: This block displays a
question in a speech bubble and waits for the user to type
an answer.
2. “Mouse x” block: This block returns the x-position of the
mouse on the stage.
3.

4. The block checks if its sprite is touching the mouse pointer, the edge, or another
sprite. If the sprite touches the selected object, the block returns true; if not, it
returns false.
5.

6. The block checks if its sprite touches a specified color. If so, the block returns
“true”.
7.

8. The block checks if a color on its sprite touches another color. If so, the block
returns “true”.
9.
10. The block indicates the Euclidean distance, in pixels, between itself and the
mouse pointer or the center of the costume of a specified sprite.
11.

12. The block will display an input box (with the specified text above) at the bottom
of the screen. Scrapers can enter text there and submit it, and the input is then
stored in the Response block. The Response block automatically updates with the
most recent entry.

Returns the most recent keystroke in the block. The variable is shared by all sprite
objects (global).

The block checks if the specified key is pressed. If the key is pressed, the block
returns “true”; if not, it returns “false”.

The block checks if the computer’s main mouse button is activated (clicked).

This block returns the abscissa x of the position of the mouse pointer.

This block returns the y ordinate of the mouse pointer position.

The block indicates the intensity of the noise received by a microphone, on a scale
from 0 to 100. To use this block, a microphone must be used, and therefore a message
will appear on the screen, asking permission to use the microphone . If you refuse it,
the block will report a volume of 0 or -1.
Returns the most recent keystroke in the block. The variable is shared by all sprite
objects (global).

The block checks if the specified key is pressed. If the key is pressed, the block
returns “true”; if not, it returns “false”.

The block checks if the computer’s main mouse button is activated (clicked).

This block returns the abscissa x of the position of the mouse pointer.

This block returns the y ordinate of the mouse pointer position.

The block indicates the intensity of the noise received by a microphone, on a scale
from 0 to 100. To use this block, a microphone must be used, and therefore a message
will appear on the screen, asking permission to use the microphone . If you refuse it,
the block will report a volume of 0 or -1.

Returns the most recent keystroke in the block. The variable is shared by all sprite
objects (global).

The block checks if the specified key is pressed. If the key is pressed, the block
returns “true”; if not, it returns “false”.

The block checks if the computer’s main mouse button is activated (clicked).
This block returns the abscissa x of the position of the mouse pointer.

This block returns the y ordinate of the mouse pointer position.

The block indicates the intensity of the noise received by a microphone, on a scale
from 0 to 100. To use this block, a microphone must be used, and therefore a message
will appear on the screen, asking permission to use the microphone . If you refuse it,
the block will report a volume of 0 or -1.

Returns the most recent keystroke in the block. The variable is shared by all sprite
objects (global).

The block checks if the specified key is pressed. If the key is pressed, the block
returns “true”; if not, it returns “false”.

The block checks if the computer’s main mouse button is activated (clicked).

This block returns the abscissa x of the position of the mouse pointer.

This block returns the y ordinate of the mouse pointer position.

The block indicates the intensity of the noise received by a microphone, on a scale
from 0 to 100. To use this block, a microphone must be used, and therefore a message
will appear on the screen, asking permission to use the microphone . If you refuse it,
the block will report a volume of 0 or –
The block starts at 0 when Scratch is launched and gradually increases; every second
it will have increased by 1.

The block will report a specified value from the specified sprite or scene.

It reports either the local year, month, date, day of the week, hour, minutes, or
seconds, depending on the argument. The block gets data based on the user’s
computer clock set to a 24-hour clock.

It reports the number of days (and fractions of days) since 00:00:00 on January 1,
2000 (UTC).

You might also like