Discuss Scratch

Bv141
New Scratcher
11 posts

Measuring speed

I have made a project where although the sprite moves a set number of steps, it's movement is modified by gravity and lift (it's a plane) so I cannot just work out it's speed by multiplying the steps.
Does anyone have any suggestions about how I could work out the accurate speed.
I have tried using the sine rule to work out a vector but it went horrifically wrong and I couldn't find any problems.
drmcw
Scratcher
1000+ posts

Measuring speed

This uses the equations of motion so may help?
Bv141
New Scratcher
11 posts

Measuring speed

What do all the variables do? The speed=distance/time is what I need, but I have never got it to work
Bv141
New Scratcher
11 posts

Measuring speed

I've got it! lists are the answer!
Ted77775
Scratcher
1 post

Measuring speed

excuse me, Bv141 but can you please explain how? im trying to use it for a game. reply ASAP
Madcatofdoom
Scratcher
500+ posts

Measuring speed

Ted77775 wrote:

excuse me, Bv141 but can you please explain how? im trying to use it for a game. reply ASAP
Please don't necropost. Make your own topic!
yayeetus789
Scratcher
2 posts

Measuring speed

um, but what are lists
Barbeque_Sus
Scratcher
100+ posts

Measuring speed

yayeetus789 wrote:

um, but what are lists
don't necropost. make a topic
King-Trisi
Scratcher
1 post

Measuring speed

bro i'm trying to findd a solution of meassuring speed in scratch
mmhmBeans
Scratcher
500+ posts

Measuring speed

King-Trisi wrote:

(#9)
bro i'm trying to findd a solution of meassuring speed in scratch

oh my god this topic was literally created in 2014 make your own
medians
Scratcher
1000+ posts

Measuring speed

mmhmBeans wrote:

King-Trisi wrote:

(#9)
bro i'm trying to findd a solution of meassuring speed in scratch

oh my god this topic was literally created in 2014 make your own
Stop making me feel old
Also, make a new topic, and you may need the distance formula.
Rscratchpro
Scratcher
6 posts

Measuring speed

Hello people!

I need help by measuring speed - When you move, then variable shows how fast speed it's moving.
It's for game

Thank you!

-Rsrcatchpro
mmhmBeans
Scratcher
500+ posts

Measuring speed

Rscratchpro wrote:

(#12)
Hello people!

I need help by measuring speed - When you move, then variable shows how fast speed it's moving.
Always create a new post when you need help, this topic is almost 10 years old.

Anyway, you need to save the previous position before moving and then compare them. Make sure that you copied the expression correctly. There isn't any built-in way of measuring distance between two points, so you'll have to use trigonometry.

when green flag clicked
forever
set [old x v] to (x position)
set [old y v] to (y position)
movement scripts::grey
set [speed v] to ([sqrt v] of ((((x position)-(old x))*((x position)-(old x)))+(((y position)-(old y))*((y position)-(old y)))))
Rscratchpro
Scratcher
6 posts

Measuring speed

Hello people!
This is RSRCTACHPRO again
I found out!
And for these steps you will need one variable so let's call it “mouse movement”
First put when flag clicked (optional)
IMPORTANT! - Put another empty sprite. This wont work on your player's sprite
2. Put forever
3. Put Go to mouse-pointer make sure it's mouse pointer
4. Repeat (num) Make sure you put 1
5.Set to (distance to (mouse-pointer)
This is it
Enjoy! This measures how fast your mosue is moving and variable will show you
-Rscratchpro
Rscratchpro
Scratcher
6 posts

Measuring speed

Here's example
when green flag clicked
forever
go to [ mouse-pointer]
repeat (1)
set [ mouse movement] to (distance to [ mouse-pointer])
end
end
Rscratchpro
Scratcher
6 posts

Measuring speed

Oops! Wrong code
when green flag clicked
forever
go to [ mouse-pointer]
repeat (1)

end
set [ mouse movement] to (distance to [ mouse-pointer])
end
Sorry for the mistake
Rscratchpro
Scratcher
6 posts

Measuring speed

mmhmBeans
How do i get Movement scripts block? I've never seen his block
Cool_Dude2022
Scratcher
500+ posts

Measuring speed

Rscratchpro wrote:

mmhmBeans
How do i get Movement scripts block? I've never seen his block

Please do not necropost.

Powered by DjangoBB