Discuss Scratch

Firespawnx
Scratcher
1 post

How do I detect movement?

I have been trying for a while now, does anyone know how to detect which way a laptop (or device with no motion sensors) is moving with the camera instead of using a different device, or adding something like a microbit? I would love some help on this topic, and also, what does “video direction mean?”
Wolf_Link21
Scratcher
100+ posts

How do I detect movement?

I don't think so

This is dave
:D :: hat :: motion
He protects my from evil kumquats.
Please follow me if you find my response helpful and give me any ideas for my game https://scratch.mit.edu/projects/992371983/
MineTurte
Scratcher
500+ posts

How do I detect movement?

Firespawnx wrote:

I have been trying for a while now, does anyone know how to detect which way a laptop (or device with no motion sensors) is moving with the camera instead of using a different device, or adding something like a microbit? I would love some help on this topic, and also, what does “video direction mean?”
I don't know much about the extra extensions of scratch but you could probably use some external device to try to sense motion. I know the video sensing extension does have a special block that can determine the amount of movement that your current camera is picking up (pretty sure it works with external cameras as well)

Hope this helps!

Last edited by MineTurte (March 25, 2024 23:30:53)


(pronouns are she/her). Advanced Alpha Game Studios Manager. Our website: https://aags2.w3spaces.com
This is JuniperActias. AKA Moth mommy. If I helped you out consider following Juni-Bug (my new account)!




If you found this secret, say uwu
Signature gradients here













BigNate469
Scratcher
500+ posts

How do I detect movement?

To detect movement using the camera is exceedingly difficult in scratch. It's already hard in other programming languages, and that's when you can get the color of pixels in an image without having to run a number of if-checks on it first to find what color is at a specific pixel. You would have to either use a computer vision algorithm to detect objects in the image and track their position, and then compare those positions, or if you just wanted to know if something is moving at all you could try to figure how blurry the image is. Both are incredibly difficult to program in scratch, although a place to start would be @griffpatch's color detection algorithm.

Highlight any part of this signature and press ctrl+shift+down arrow to see the rest of it
forever
if <person asks [what's a signature] :: sensing> then
Redirect to [https://en.scratch-wiki.info/wiki/Signature] :: motion
end
end
Please read the list of Officially Rejected Suggestions before posting a suggestion for Scratch! 100th post
This signature is designed to be as helpful as possible.
View all of the topics you've posted in:
https://scratch.mit.edu/discuss/search/?action=show_user&show_as=topics
View all of your posts:
https://scratch.mit.edu/discuss/search/?action=show_user&show_as=posts
Forum tips:
Don't title topics something like “HELP ME!!!”. It's not helpful, and won't get you as many responses.
Don't post in topics where the latest post is over ~2 months old, unless you have something critical to add. Especially in topics that are several years old- it isn't helpful, and is known as necroposting.
Don't post unrelated things in topics, including questions of your own. Make a new topic for your questions.
You can use the
 [code] and [/code] 
tags to show other users how to format something that Scratch would otherwise format.
You can use the
 [color=color name or hexadecimal value here] and [/color] 
tags to color text.
Little-known Scratch URLs:
scratch.pizza (redirects to main page)
https://scratch.mit.edu/projects/PROJECT ID HERE/remixtree (replace “PROJECT ID HERE” with project id number. Shows all the remixes of the project, and the remixes of those projects, and the remixes of those projects, and so on, as a chart. Link currently redirects to one of my projects)

Powered by DjangoBB