Discuss Scratch

lbtybxc
Scratcher
28 posts

Sensing Blocks

Hi fellow Scratchers! I was wondering how to use most of the blocks in the Sensing category in the Scratch project editor. I've never really had the need to use anything in the Sensing category but I want to explore Scratch in more detail. Thank you so much if you can help!
mstone326
Scratcher
1000+ posts

Sensing Blocks

This will be a good place to start. Good luck

https://wiki.scratch.mit.edu/wiki/Sensing_Blocks
Uniquename1
Scratcher
100+ posts

Sensing Blocks

<touching [ v] ?>

I'll use this one because I do mostly action physical type of games. One of the more common and useful ones.

<key [ v] pressed?>

This is another common useful one you've probably used. It's much better than a when key pressed flag hat for most things but requires you to add a green flag clicked flag hat and some kind of loop (not that I constantly use forevers…)

I've heard bad things about touching color I avoid using it. Distance to also has never seemed to work right for me. I don't ask questions in my games or care about the timer but those are options. Some blocks deal with video hook ups.

<mouse down?> 

and

([ v] of [Sprite1 v])

have seemed useful. The first i believe is just a button click on the mouse though may be like dragging something or a shorter version of wait until not mouse clicked not sure if it's different than when key pressed. The 2nd can be used to compare distance between 2 things or tell something where something else is.

If you right click and read the help it tells you a bit and there's more in depth stuff for most on the wiki.
dual_creator43
Scratcher
1000+ posts

Sensing Blocks

You can look at my tutorial of sensing blocks.
<touching [ v] ?>
This shows whether or not you're touching something. It's usually used to check if you're touching a sprite, but can also be used to check if you're touching the mouse.
<touching color [#552148] ?>
This block checks for if the sprite with this in its script is touching a color. When in the editor, the color is usually a random color, but to change the color, click on the color, then click on the color you want to change it to. Just know that when using this block in the forums, you have to type in the hexadecimal name for that color. You can find the one you want here.
<color [#9a3c67] is touching [#e45c9d] ?>
This block checks if a color is touching another color in the backdrop, a sprite, or anything else in the project. To change the color, it's the same as the other block.
(distance to [ v])
This block shows you how far away the sprite is from another sprite or the mouse.
ask [] and wait
(answer)
These two blocks go well together. The first one asks you something that you can answer with whatever you want, and the other block records the answer.
<key [ v] pressed?>
This checks for if a certain key is pressed. It has basically the same effect as a when certain key pressed hat block.
<mouse down?>
This block checks for when you click. It is often used with the touching sprite block to substitute the when this sprite clicked hat block.
(mouse x)
(mouse y)
These two blocks record the x and y positions of the mouse. If used together, they can provide a more precise way to check if the mouse is touching a sprite.
(loudness)
(video [ v] on [Stage v])
These two blocks are used with the webcam and microphone. The first one records the loudness sensed by the microphone, and the second one is for the motion or direction of a sprite or the backdrop, though this block is the only one I don't know that well.
turn video [ v]
This block has three uses. On turns on the webcam and microphone, off turns them off, and on-flipped flips the webcam.
set video transparency to () %
This block is like the ghost effect block, but for the webcam. The higher it is, the more transparent it is.
(timer)
reset timer
The timer block records how much time is spent on the project. The reset timer block sets the timer back to 0.
([ v] of [Sprite1 v])
This block records the x or y position of a sprite. It can also record the backdrop number, backdrop name, or volume (why would you need the volume of a backdrop?).
(current [ v])
(days since 2000)
These two blocks are both about the date. The first one can tell you the current year, month, day, day of the week, hour, minute, or second. The second block tells you the exact number of days since January 1, 2000.
(username)
This is the final block of the Sensing category, and if the user is logged in, it records the username of the user. If the user is not signed in, it just shows a blank space.

I hope my tutorial helped you better understand the power and effect of each of the Sensing blocks!
lbtybxc
Scratcher
28 posts

Sensing Blocks

Thanks everyone who replied! I didn't think I would get this many in one day I will definitely make sure to take time and read all these resources. Soon I will be using sensing blocks in my projects! Again, thank you!
RebelRolen
New Scratcher
1 post

Sensing Blocks

how do you make a sensing block
deck26
Scratcher
1000+ posts

Sensing Blocks

RebelRolen wrote:

how do you make a sensing block
You don't make a sensing block, you copy it into your code area like any other block. Please don't necropost, create your own new topic.
speakableplayz
Scratcher
20 posts

Sensing Blocks

([ v] of [Sprite1 v]) I'm looking for this sensing block in my project but I don't see it 1
swswjode
Scratcher
7 posts

Sensing Blocks

<touching [ v] ?>
say []
stop all sounds
pen up
when this sprite clicked
when backdrop switches to [ v]
if <> then

end
MathPuppy314
Scratcher
500+ posts

Sensing Blocks

speakableplayz wrote:

([ v] of [Sprite1 v]) I'm looking for this sensing block in my project but I don't see it 1

swswjode wrote:

<touching [ v] ?>
say []
stop all sounds
pen up
when this sprite clicked
when backdrop switches to [ v]
if <> then

end
Please don't blockspam or necropost. If you have a problem, make your own topic.
XandaThePanda27
Scratcher
51 posts

Sensing Blocks

this is a movement script with a sensing block, i always remeber is this
when [d] key pressed
repeat until <not <key [d] pressed?>>
change x by (5)
end


think [Classic Movement....] for (2) secs


say [Your Welcome!] for (2) secs

set [XandaThePanda27] to [Genius]
Edddyson
Scratcher
7 posts

Sensing Blocks

when green flag clicked
dhfbei8987
Scratcher
1000+ posts

Sensing Blocks

Edddyson wrote:

when green flag clicked

MathPuppy314 wrote:

]
Please don't blockspam or necropost. If you have a problem, make your own topic.
0IIUwUII0
Scratcher
6 posts

Sensing Blocks

when green flag clicked
clear
Yusei-Fudo
Scratcher
1000+ posts

Sensing Blocks

0IIUwUII0 wrote:

when green flag clicked
clear

Don't Necropost!

Powered by DjangoBB