Discuss Scratch
- Discussion Forums
- » Suggestions
- » Point to (X) (Y) block
- ZozaTech
-
500+ posts
Point to (X) (Y) block
Insead of all the code used to make it, add the point towards (X) (Y) block.
- DaSpudLord
-
1000+ posts
Point to (X) (Y) block
No support, workaroundable using multiple methods.
- VoltageGames
-
1000+ posts
Point to (X) (Y) block
here, why don't I actually put the workaround? No support, workaroundable using multiple methods.
make a small sprite, put it at (x,y) and have your sprite point to it. It'll be looking at (x,y)
- DaSpudLord
-
1000+ posts
Point to (X) (Y) block
Or you can use trig.here, why don't I actually put the workaround? No support, workaroundable using multiple methods.
make a small sprite, put it at (x,y) and have your sprite point to it. It'll be looking at (x,y)
- Zekrom01
-
1000+ posts
Point to (X) (Y) block
Semi-support, use an invisible sprite.
Example sprite is sprite2
But I agree, this would make things less boring, and easier.
Example sprite is sprite2
point towards [sprite2 v]
But I agree, this would make things less boring, and easier.
- flutehamster
-
500+ posts
Point to (X) (Y) block
Semi-support, use an invisible sprite.
Example sprite is sprite2point 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…
- DrKat123
-
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
-
1000+ posts
Point to (X) (Y) block
Or even a single line: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
define Point Towards X: (x) Y: (y)(…which will avoid the cost of Scratch doing all the calculations for rotation of a sprite's costume twice).
point in direction ( ([atan v] of (((x position) - (x)) / ((y position) - (y)))) + ( (180) * ( (y) < (y position) )
Last edited by TheLogFather (Sept. 29, 2015 19:58:59)
- stickfiregames
-
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
-
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.
Yup, scratch is a programming language for learning, so we should make it easier, not to make it more complicated.
- CatsUnited
-
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
-
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])
- CatsUnited
-
1000+ posts
Point to (X) (Y) block
nerd lol Support, since most Scratchers don't know trigonometry (which is a maths branch that I want to learn real soon …
*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
-
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
-
1000+ posts
Point to (X) (Y) block
Mockup:
Support as the workaround is hard. (and who wants a whole another sprite!?)
point towards x:()y:()::motion stack
[scratchblocks]
point towards x:()y:()::motion stack
[/scratchblocks]
- Harakou
-
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!
- Discussion Forums
- » Suggestions
-
» Point to (X) (Y) block