|This page has links to sites outside of the Scratch website and Wikipedia. Always remember to stay safe when using the Internet, since we can't guarantee the safety of other sites.|
|Video () on ()|
The Video () on () block is a Sensing block and a Reporter block. It gets values of the video, either motion (on a scale of 1 to 100) or direction (which way the detected motion is going, measured on the same plane as sprite direction), on either the Stage, or the current sprite.
It calculates the values based on "optical flow".
- Moving a sprite by moving
forever move (video [motion v] on [this sprite v]) steps point in direction (video [direction v] on [this sprite v])
- Popping balloons
if <(video [motion v] on [this sprite v]) > > then play sound [pop v] hide end
- Sensing lots of action, by also using loudness
when gf clicked forever if < <(video [motion v] on [Stage v]) > > and <not <(loudness) > >> > then say [Turn up the volume!] end if < <not <(video [motion v] on [Stage v]) > >> and <(loudness) > > > then say [Start moving!] end if <<(video [motion v] on [Stage v]) > > and <(loudness) > >> then say [Party!] end
Touching ()? • Touching Color ()? • Color () is Touching ()? • Distance to () • Ask () and Wait • Answer • Key () Pressed? • Mouse Down? • Mouse X • Mouse Y • Loudness • Video () on () • Turn Video () • Set Video Transparency to ()% • Timer • Reset Timer • () of () • Current () • Days Since 2000 • UsernameMore blocks...