Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Distance to (x) (y) script
- hello2248
-
100+ posts
Distance to (x) (y) script
could someone help me with making that please? I need it for my game, it would just calculate the distance between a sprite and a coordinate.
define distance to (x) (y)
- qazqweplm
-
19 posts
Distance to (x) (y) script
You could make an invisible sprite, make it go to the xy location, then use the sensing value block (distance to _).
- footsocktoe
-
1000+ posts
Distance to (x) (y) script
There are no blocks for pure coordinates. There has to be something there and then you use the coordinates of that. Use a one pixel sprite and you can make it invisible like @qazqweplm suggested by giving it a ghost effect of 100. Don't forget to put the costume center dead on it.
- gtoal
-
1000+ posts
Distance to (x) (y) script
could someone help me with making that please? I need it for my game, it would just calculate the distance between a sprite and a coordinate.define distance to (x) (y)
Remember pythagoras?
- crisostimo
-
500+ posts
Distance to (x) (y) script
I remember Pythagoras.
define distance to (x) (y)
set [Calculated Distance v] to ([sqrt v] of (( ((x position) - (x)) * ((x position) - (x)) ) + ( ((y position) - (y)) * ((y position) - (y)) )))
Last edited by crisostimo (Dec. 30, 2015 04:54:03)
- Discussion Forums
- » Help with Scripts
-
» Distance to (x) (y) script