Discuss Scratch
- Discussion Forums
- » Suggestions
- » New Sensing Block Ideas (Support? Feedback? Workarounds?)
- Aboot4
-
Scratcher
100+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
I've needed this very badly on several projects I've made:
What about these edits to already existing sensing blocks?
So… support? Feedback/ WORKAROUNDS?! xP
(Distance to x:() y:() ::sensingInstead, I use a workaround that's a pain, because you have to create a new sprite EVERY TIME YOU USE IT, have it go to that x and y value, then tell the OTHER sprite to test the distance to it. But what if there was an easier way? This block, in my opinion, would be very useful!
What about these edits to already existing sensing blocks?
(Distance to [Nearest Clone v] of [Sprite1 v] ::sensing
(Distance to [Farthest Clone v] of [Sprite1 v] ::sensing
So… support? Feedback/ WORKAROUNDS?! xP
- Pot-of-Gold
-
Scratcher
1000+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
I've needed this very badly on several projects I've made:(Distance to x:() y:() ::sensing // Support. although you could make one sprite go to each locationInstead, I use a workaround that's a pain, because you have to create a new sprite EVERY TIME YOU USE IT, have it go to that x and y value, then tell the OTHER sprite to test the distance to it. But what if there was an easier way? This block, in my opinion, would be very useful!
What about these edits to already existing sensing blocks?(Distance to [Nearest Clone v] of [Sprite1 v] ::sensing // support
(Distance to [Farthest Clone v] of [Sprite1 v] ::sensing // support
So… support? Feedback/ WORKAROUNDS?! xP
- -Io-
-
Scratcher
1000+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
define distance from x:(x1) y:(y1) to x:(x2) y:(y2)Pythagorean Theorem
set [distance v] to ([sqrt v] of ((((x1)-(x2))*((x1)-(x2)))+(((y1)-(y2))*((y1)-(y2)))))
Last edited by -Io- (July 3, 2015 03:44:42)
- DaSpudLord
-
Scratcher
1000+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
No support due to the above workaround. Or you could always just move another sprite to that location and record the distance to that sprite.
- Aboot4
-
Scratcher
100+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
Ah, good call! I didn't think of that!define distance from x:(x1) y:(y1) to x:(x2) y:(y2)Pythagorean Theorem
set [distance v] to ([sqrt v] of ((((x1)-(x2))*((x1)-(x2)))+(((y1)-(y2))*((y1)-(y2)))))
- stickfiregames
-
Scratcher
1000+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
Support.
- Aboot4
-
Scratcher
100+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
Except you did it wrong - the “y” section comes first. xPdefine distance from x:(x1) y:(y1) to x:(x2) y:(y2)Pythagorean Theorem
set [distance v] to ([sqrt v] of ((((x1)-(x2))*((x1)-(x2)))+(((y1)-(y2))*((y1)-(y2)))))
- stickfiregames
-
Scratcher
1000+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
It makes no difference.Except you did it wrong - the “y” section comes first. xPdefine distance from x:(x1) y:(y1) to x:(x2) y:(y2)Pythagorean Theorem
set [distance v] to ([sqrt v] of ((((x1)-(x2))*((x1)-(x2)))+(((y1)-(y2))*((y1)-(y2)))))
- Aboot4
-
Scratcher
100+ posts
New Sensing Block Ideas (Support? Feedback? Workarounds?)
Shhhh xPIt makes no difference.Except you did it wrong - the “y” section comes first. xPdefine distance from x:(x1) y:(y1) to x:(x2) y:(y2)Pythagorean Theorem
set [distance v] to ([sqrt v] of ((((x1)-(x2))*((x1)-(x2)))+(((y1)-(y2))*((y1)-(y2)))))
- Discussion Forums
- » Suggestions
-
» New Sensing Block Ideas (Support? Feedback? Workarounds?)







