Discuss Scratch
- Discussion Forums
- » Suggestions
- » a [point towards x( ) y( ) block
- pokejofe
-
68 posts
a [point towards x( ) y( ) block
Support! I have had to use the workaround:
Sprite1 (a dot)
Sprite1 (a dot)
when I receive [move v]Sprite2 (what I want to point to the dot)
go to x: ( destination x) y: ( destination y)
broadcast [point v]
When I should point :: custom hat
set [destination x v] to [ ...]
set [destination y v] to [ ...]
broadcast [move v]
when I receive [point v]
point towards [Sprite1 v]
Last edited by pokejofe (June 9, 2015 13:37:51)
- tim556688
-
82 posts
a [point towards x( ) y( ) block
Support, support, support…. support ……. 

- TheMonsterOfTheDeep
-
1000+ posts
a [point towards x( ) y( ) block
Support.
Guys, the point isn't that the workaround is possible, it's that it is extremely difficult and could not be figured out by somebody new to Scratch. Blocks are almost always useful unless their workaround is only a few blocks.
Aside from that, the workaround requires multiple extra variables (don't say “use lists”) which clutter up the project.
Guys, the point isn't that the workaround is possible, it's that it is extremely difficult and could not be figured out by somebody new to Scratch. Blocks are almost always useful unless their workaround is only a few blocks.
Aside from that, the workaround requires multiple extra variables (don't say “use lists”) which clutter up the project.
- Iloverollercoasters
-
100+ posts
a [point towards x( ) y( ) block
Real support. It's not very necessary for stuff.
love*click* favorite*click*.

- 20btheilmanngohr
-
100+ posts
a [point towards x( ) y( ) block
Because we have an actual workaround, I semi support. It's possible already, but it would be more efficient. Support! I have had to use the workaround:
Sprite1 (a dot)when I receive [move v]Sprite2 (what I want to point to the dot)
go to x: ( destination x) y: ( destination y)
broadcast [point v]When I should point :: custom hat
set [destination x v] to [ ...]
set [destination y v] to [ ...]
broadcast [move v]
when I receive [point v]
point towards [Sprite1 v]
- thelucariokid
-
100+ posts
a [point towards x( ) y( ) block
I just make an invisible sprite, and make it point towards that
- Zro716
-
1000+ posts
a [point towards x( ) y( ) block
maybe just an atan2 function instead because then you could do
point in direction (direction to x:(100) y:(100) ::operators)and wouldn't have to rely on a sprite's direction for the operation (because you might already be using it for something else)
- Hamish752
-
1000+ posts
a [point towards x( ) y( ) block
Support.
Obviously there is a workaround but that's not the point. Would we remove the forever block because there is a workaround? No. Although there is a workaround it can be challenging for new scratchers and pointing to an invisible sprite will slow down the project. I give you my full support.
Obviously there is a workaround but that's not the point. Would we remove the forever block because there is a workaround? No. Although there is a workaround it can be challenging for new scratchers and pointing to an invisible sprite will slow down the project. I give you my full support.
- stickfiregames
-
1000+ posts
a [point towards x( ) y( ) block
Support for this. maybe just an atan2 function instead because then you could dopoint in direction (direction to x:(100) y:(100) ::operators)and wouldn't have to rely on a sprite's direction for the operation (because you might already be using it for something else)
- Pot-of-Gold
-
1000+ posts
a [point towards x( ) y( ) block
Why? no support
Now changing status to support
- Aboot4
-
100+ posts
a [point towards x( ) y( ) block
No support. Easily workaroundable.
define point towards coordinates x: (x) y: (Y)See?
if <((Y) - (y position)) = [0]> then
if <(x) < (x position)> then
point in direction (-90 v)
else
point in direction (90 v)
end
else
if <((Y) - (y position)) > [0]> then
point in direction ([atan v] of (((x) - (x position)) / ((Y) - (y position))))
else
point in direction (([atan v] of (((x) - (x position)) / ((Y) - (y position)))) - (180))
end
end
- Tymewalk
-
1000+ posts
a [point towards x( ) y( ) block
Support for this. The “direction to” block here would also be useful elsewhere. maybe just an atan2 function instead because then you could dopoint in direction (direction to x:(100) y:(100) ::operators)and wouldn't have to rely on a sprite's direction for the operation (because you might already be using it for something else)
- Charmind
-
500+ posts
a [point towards x( ) y( ) block
is that so hard to go to scratch wiki?
- duckboycool
-
1000+ posts
a [point towards x( ) y( ) block
no support
Wow I wrote on this without realizing I already have no support, there are tutorials
- Zro716
-
1000+ posts
a [point towards x( ) y( ) block
FYI, it took me No support. Easily workaroundable.weeks before I actually figured how that all worked out (keep in mind I wasn't too keen in trigonometry back then), so calling it “easily workaroundable” doesn't match up to its actual difficulty.define point towards coordinates x: (x) y: (Y)See?
if <((Y) - (y position)) = [0]> then
if <(x) < (x position)> then
point in direction (-90 v)
else
point in direction (90 v)
end
else
if <((Y) - (y position)) > [0]> then
point in direction ([atan v] of (((x) - (x position)) / ((Y) - (y position))))
else
point in direction (([atan v] of (((x) - (x position)) / ((Y) - (y position)))) - (180))
end
end
EDIT: Also, the workaround is a LOT simpler:
define point in direction to x: (x) y: (y)
point in direction (([atan v] of (((x) - (x position)) / ((y) - (y position)))) + ((180) * <(y position) > (y)>))
Last edited by Zro716 (June 30, 2015 01:09:51)
- Discussion Forums
- » Suggestions
-
» a [point towards x( ) y( ) block