Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to show the distance between two objects (eg. mouse from player)
- BluePiano2012
-
0 posts
how to show the distance between two objects (eg. mouse from player)
I'm making a golf template and need a way to use the distance of the mouse from the ball as a variable of how powerful the shot will be
- Dragonmyflesh
-
500+ posts
how to show the distance between two objects (eg. mouse from player)
Last edited by Dragonmyflesh (July 30, 2024 04:06:37)
- RokCoder
-
1000+ posts
how to show the distance between two objects (eg. mouse from player)
@Dragonmyflesh offers a solid solution that is useful in many situations - d=√[(x2-x1)²+(y2-y1)²]
However, for the distance from a sprite to the mouse pointer you can simply use the build in distance block -
However, for the distance from a sprite to the mouse pointer you can simply use the build in distance block -
- Discussion Forums
- » Help with Scripts
-
» how to show the distance between two objects (eg. mouse from player)