Discuss Scratch

pokejofe
Scratcher
68 posts

a [point towards x( ) y( ) block

Support! I have had to use the workaround:

Sprite1 (a dot)
when I receive [move v]
go to x: ( destination x) y: ( destination y)
broadcast [point v]
Sprite2 (what I want to point to the dot)
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)

rollercoasterfan
Scratcher
1000+ posts

a [point towards x( ) y( ) block

Support.
tim556688
Scratcher
82 posts

a [point towards x( ) y( ) block

Support, support, support…. support …….
JakeTheProgrammer
Scratcher
100+ posts

a [point towards x( ) y( ) block

Support
IronBit_Studios
Scratcher
1000+ posts

a [point towards x( ) y( ) block

Support.
TheMonsterOfTheDeep
Scratcher
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.
Iloverollercoasters
Scratcher
100+ posts

a [point towards x( ) y( ) block

Real support. It's not very necessary for stuff. love*click* favorite*click*.
20btheilmanngohr
Scratcher
100+ posts

a [point towards x( ) y( ) block

pokejofe wrote:

Support! I have had to use the workaround:

Sprite1 (a dot)
when I receive [move v]
go to x: ( destination x) y: ( destination y)
broadcast [point v]
Sprite2 (what I want to point to the dot)
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]
Because we have an actual workaround, I semi support. It's possible already, but it would be more efficient.
thelucariokid
Scratcher
100+ posts

a [point towards x( ) y( ) block

I just make an invisible sprite, and make it point towards that
Zro716
Scratcher
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
Scratcher
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.
stickfiregames
Scratcher
1000+ posts

a [point towards x( ) y( ) block

Zro716 wrote:

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)
Support for this.
Boloco5
Scratcher
5 posts

a [point towards x( ) y( ) block

Support
Pot-of-Gold
Scratcher
1000+ posts

a [point towards x( ) y( ) block

duckboycool wrote:

no support
Why?
Now changing status to support
Aboot4
Scratcher
100+ posts

a [point towards x( ) y( ) block

No support. Easily workaroundable.
define point towards coordinates x: (x) y: (Y)
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
See?
Tymewalk
Scratcher
1000+ posts

a [point towards x( ) y( ) block

Zro716 wrote:

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)
Support for this. The “direction to” block here would also be useful elsewhere.
Charmind
Scratcher
500+ posts

a [point towards x( ) y( ) block

is that so hard to go to scratch wiki?
duckboycool
Scratcher
1000+ posts

a [point towards x( ) y( ) block

no support, there are tutorials
duckboycool
Scratcher
1000+ posts

a [point towards x( ) y( ) block

duckboycool wrote:

no support

duckboycool wrote:

no support, there are tutorials
Wow I wrote on this without realizing I already have
Zro716
Scratcher
1000+ posts

a [point towards x( ) y( ) block

Aboot4 wrote:

No support. Easily workaroundable.
define point towards coordinates x: (x) y: (Y)
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
See?
FYI, it took me 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.

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)

Powered by DjangoBB