Discuss Scratch
- Discussion Forums
- » Suggestions
- » a [point towards x( ) y( ) block
- Tris_das_Einhorn
-
100+ posts
a [point towards x( ) y( ) block
Support, yes it is workaround-able but both of the workarounds are inconvenient, especially for less experienced Scratchers, and it seems like this would be a fairly straightforward (and very useful!) feature to add to an already-existing block.
- DangerPuppy10
-
1000+ posts
a [point towards x( ) y( ) block
You have a backpack and can just
But yes. SUPPORT! (Makes everything 900 times easier.)
define point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
- Malicondi
-
1000+ posts
a [point towards x( ) y( ) block
x and y are in the incorrect spots: You have a backpack and can justdefine point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
TOA:
atan of opposite / adjacent:
atan of (y - y pos) / (x - x pos)
just a small correction, but it won't work without it.
- portalpower
-
1000+ posts
a [point towards x( ) y( ) block
This does not work. Scratch has a different angle system than trig, so treating them the same will make it offset by 90 degrees and in the opposite direction. Fortunately, you can solve both problems by taking the inverse and swapping the positions. Why do people post workarounds without testing them?x and y are in the incorrect spots: You have a backpack and can justdefine point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
TOA:
atan of opposite / adjacent:
atan of (y - y pos) / (x - x pos)
just a small correction, but it won't work without it.
- TheUltimateHoodie
-
1000+ posts
a [point towards x( ) y( ) block
interesting…this thread has been alive since 2013? i looked through the entire thread…
anyways, no support, there's an easy workaround
anyways, no support, there's an easy workaround
- Malicondi
-
1000+ posts
a [point towards x( ) y( ) block
Why do people post workarounds without testing them?that isn't my workaround this workaround works 100% of the time: This does not work. Scratch has a different angle system than trig, so treating them the same will make it offset by 90 degrees and in the opposite direction. Fortunately, you can solve both problems by taking the inverse and swapping the positions.
define point towards x: (x) y: (y)for a one line workaround you can use this:
if <(y) < (y position)> then
point towards (([atan v] of (((y) - (y position)) / ((x) - (x position)))) + (180))
else
point towards ([atan v] of (((y) - (y position)) / ((x) - (x position))))
point towards (([atan v] of (((y :: custom-arg) - (y position)) / ((x :: custom-arg) - (x position)))) + ((180) * <(y ::custom-arg) < (y position)>))but i think it's less readable
Last edited by Malicondi (March 1, 2024 12:04:30)
- alphabetlorefan2003
-
100+ posts
a [point towards x( ) y( ) block
After 11 years, this is still going and I support it because of how well this will work in some projects, definitely add it
- DangerPuppy10
-
1000+ posts
a [point towards x( ) y( ) block
I tested the workaround. It worked. Guess not. my backpack has incorrect information :oThis does not work. Scratch has a different angle system than trig, so treating them the same will make it offset by 90 degrees and in the opposite direction. Fortunately, you can solve both problems by taking the inverse and swapping the positions. Why do people post workarounds without testing them?x and y are in the incorrect spots: You have a backpack and can justdefine point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
TOA:
atan of opposite / adjacent:
atan of (y - y pos) / (x - x pos)
just a small correction, but it won't work without it.
- plantskym2
-
500+ posts
a [point towards x( ) y( ) block
Semi-support but more on the no support side because this could be really useful for people such as new scratchers, there are workarounds and most people know them.
- medians
-
1000+ posts
a [point towards x( ) y( ) block
He meant the other guy, that one does not work properly.I tested the workaround. It worked. Guess not. my backpack has incorrect information :oThis does not work. Scratch has a different angle system than trig, so treating them the same will make it offset by 90 degrees and in the opposite direction. Fortunately, you can solve both problems by taking the inverse and swapping the positions. Why do people post workarounds without testing them?x and y are in the incorrect spots: You have a backpack and can justdefine point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
TOA:
atan of opposite / adjacent:
atan of (y - y pos) / (x - x pos)
just a small correction, but it won't work without it.
- Malicondi
-
1000+ posts
a [point towards x( ) y( ) block
yes yes i know i got my trig messed up this script does actually work 100% of the time though, i tested: He meant the other guy, that one does not work properly.
define point towards x: (x) y: (y)i am ashamed of my sub-par trigonometry skills right now because of my last post
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <((y) - (y position)) < (0)>))
- DangerPuppy10
-
1000+ posts
a [point towards x( ) y( ) block
Makes sense why he quoted Malicondi instead of just me. no offense, just wanted to say that.He meant the other guy, that one does not work properly.I tested the workaround. It worked. Guess not. my backpack has incorrect information :oThis does not work. Scratch has a different angle system than trig, so treating them the same will make it offset by 90 degrees and in the opposite direction. Fortunately, you can solve both problems by taking the inverse and swapping the positions. Why do people post workarounds without testing them?x and y are in the incorrect spots: You have a backpack and can justdefine point in direction to x: (x) y: (y)backpack that. I know people may not be able to understand it. Even I don't. yet. But this is the best option for now.
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
But yes. SUPPORT! (Makes everything 900 times easier.)
TOA:
atan of opposite / adjacent:
atan of (y - y pos) / (x - x pos)
just a small correction, but it won't work without it.
I already “corrected ” the one in my backpack. now it ACTUALLY has incorrect information. Doing this feels like walking around in endless circles.
- LionCoder10
-
500+ posts
a [point towards x( ) y( ) block
support, this block is very useful and the workaround is hard (for beginner scratchers, I think I can handle it)
- NotK3ndricAlt
-
1000+ posts
a [point towards x( ) y( ) block
Why do I remember this block being rejected?
- MagicCoder330
-
1000+ posts
a [point towards x( ) y( ) block
No support easy workaround *proceeds to spout out a large mess of operator blocks that no new scratcher has any hope of understanding*
I think that this would help a lot, it would keep projects from being as cluttered as before and help new people use it.
I think that this would help a lot, it would keep projects from being as cluttered as before and help new people use it.
- MagicCoder330
-
1000+ posts
a [point towards x( ) y( ) block
I think your thinking of the pointing towards sprite block, that was rejected Why do I remember this block being rejected?
Sorry, you have to wait 60 seconds between posts.
- Discussion Forums
- » Suggestions
-
» a [point towards x( ) y( ) block