Discuss Scratch

ZozaTech
Scratcher
500+ posts

Point to (X) (Y) block

Insead of all the code used to make it, add the point towards (X) (Y) block.
DaSpudLord
Scratcher
1000+ posts

Point to (X) (Y) block

No support, workaroundable using multiple methods.
VoltageGames
Scratcher
1000+ posts

Point to (X) (Y) block

DaSpudLord wrote:

No support, workaroundable using multiple methods.
here, why don't I actually put the workaround?

make a small sprite, put it at (x,y) and have your sprite point to it. It'll be looking at (x,y)
DaSpudLord
Scratcher
1000+ posts

Point to (X) (Y) block

VoltageGames wrote:

DaSpudLord wrote:

No support, workaroundable using multiple methods.
here, why don't I actually put the workaround?

make a small sprite, put it at (x,y) and have your sprite point to it. It'll be looking at (x,y)
Or you can use trig.
Zekrom01
Scratcher
1000+ posts

Point to (X) (Y) block

Semi-support, use an invisible sprite.
Example sprite is sprite2

point towards [sprite2 v]

But I agree, this would make things less boring, and easier.
flutehamster
Scratcher
500+ posts

Point to (X) (Y) block

Zekrom01 wrote:

Semi-support, use an invisible sprite.
Example sprite is sprite2

point towards [sprite2 v]

But I agree, this would make things less boring, and easier.

Oh yhea. That way and this way:
define Point Towards X: (x) Y: (y)
point in direction ([atan v] of (((x position) - (x)) / ((y position) - (y)))
if <(y) < (y position) > then

point in direction ((direction) + (180))
end

It should work…
scratchinghead
Scratcher
1000+ posts

Point to (X) (Y) block

Support, I really need that.
DrKat123
Scratcher
1000+ posts

Point to (X) (Y) block

No support.workarounable with trigonometry and there's a scratch wiki tutorial to do that (with trigonometry, which happens to be my favorite mathematics branch)
TheLogFather
Scratcher
1000+ posts

Point to (X) (Y) block

flutehamster wrote:

define Point Towards X: (x) Y: (y)
point in direction ([atan v] of (((x position) - (x)) / ((y position) - (y)))
if <(y) < (y position) > then
point in direction ((direction) + (180))
end
Or even a single line:
define Point Towards X: (x) Y: (y)
point in direction ( ([atan v] of (((x position) - (x)) / ((y position) - (y)))) + ( (180) * ( (y) < (y position) )
(…which will avoid the cost of Scratch doing all the calculations for rotation of a sprite's costume twice).

Last edited by TheLogFather (Sept. 29, 2015 19:58:59)

stickfiregames
Scratcher
1000+ posts

Point to (X) (Y) block

Support. You can't expect everyone to know trigonometry (since the average age of the Scratch community is 12), and using an invisible sprite requires extra variables, scripts and broadcasts for what should be a simple rotation.
scratchinghead
Scratcher
1000+ posts

Point to (X) (Y) block

stickfiregames wrote:

Support. You can't expect everyone to know trigonometry (since the average age of the Scratch community is 12), and using an invisible sprite requires extra variables, scripts and broadcasts for what should be a simple rotation.

Yup, scratch is a programming language for learning, so we should make it easier, not to make it more complicated.
ChocoBox
Scratcher
46 posts

Point to (X) (Y) block

Support!
CatsUnited
Scratcher
1000+ posts

Point to (X) (Y) block

Support, since most Scratchers don't know trigonometry (which is a maths branch that I want to learn real soon, along with prealgebra), and the other workaround requires another sprite.
powercon5
Scratcher
1000+ posts

Point to (X) (Y) block

support as I think it is more useful than
point towards [ v]
as with this you could just use

([y v] of [sprite v])
([x v] of [sprite v])
Rendangbike2
Scratcher
1000+ posts

Point to (X) (Y) block

Bump
CatsUnited
Scratcher
1000+ posts

Point to (X) (Y) block

CatsUnited wrote:

Support, since most Scratchers don't know trigonometry (which is a maths branch that I want to learn real soon …
nerd lol
*stares at calculus homework*

I still want to see this added. I would see having a sprite point to a particular part of the screen that isn't a sprite as common enough of a use case to include this block. It's similar to the move () steps block in that it's a block that you can workaround with trigonometry, but is still included due to it's usefulness to an audience that contains a lot of people unaware of the sines and cosines of the world
the2000
Scratcher
1000+ posts

Point to (X) (Y) block

I'm not sure why most blocks which involve coordinates have sprite dropdown and number input variants, but the "point to [sprite v]" block doesn't. I could understand missing the sprite variant since it's a three block workaround, but not having a number input variant is really weird. Definitely should be added in my opinion.
han614698
Scratcher
1000+ posts

Point to (X) (Y) block

Mockup:
point towards x:()y:()::motion stack
[scratchblocks]
point towards x:()y:()::motion stack
[/scratchblocks]
Support as the workaround is hard. (and who wants a whole another sprite!?)
Harakou
Scratcher
1000+ posts

Point to (X) (Y) block

Hello! I believe this has been suggested before in this topic - to help keep discussion centralized, please use the existing topic. Thanks!

Powered by DjangoBB