This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-22 10:54:17

AmitDigga
New Scratcher
Registered: 2011-04-21
Posts: 18

New block "Direction to _____"

As my profile is new so I cannt post on suggestion page so here it is..

There should be a new block "Direction to (any sprite)" which will give the numerical value of the angle formed by the line joining them...basically "Point toward" cannot be used for multiple sprite...(Please post any thing which I am missing)

Offline

 

#2 2012-07-22 10:56:24

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: New block "Direction to _____"

Can't you just have a line sprite that goes to the sprite recieving and points to the sprite sending?  Then, use the

([direction v] of [line sprite v])


http://i47.tinypic.com/2iaa73k.png

Offline

 

#3 2012-07-29 10:56:10

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: New block "Direction to _____"

Trigonometry.

That is all.


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#4 2012-07-29 12:32:48

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: New block "Direction to _____"

Use variables:

set [od v] to (direction)
point towards [whatever v]
set [target v] to (direction)
point in direction (od)
The variable "target" will contain you answer.  smile


http://i50.tinypic.com/312u714.jpg

Offline

 

#5 2012-07-29 14:14:46

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: New block "Direction to _____"

BirdByte wrote:

Use variables:

set [od v] to (direction)
point towards [whatever v]
set [target v] to (direction)
point in direction (od)
The variable "target" will contain you answer.  smile

If you are paying close enough attention, you can see the frame(s) when it is rotated.


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#6 2012-07-29 14:26:09

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: New block "Direction to _____"

lalala3 wrote:

BirdByte wrote:

Use variables:

set [od v] to (direction)
point towards [whatever v]
set [target v] to (direction)
point in direction (od)
The variable "target" will contain you answer.  smile

If you are paying close enough attention, you can see the frame(s) when it is rotated.

Not online. Online it runs in Single Frame, only updating at the end of loops and waits.

Offline

 

#7 2012-07-31 10:35:37

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: New block "Direction to _____"

scimonster wrote:

lalala3 wrote:

BirdByte wrote:

Use variables:

set [od v] to (direction)
point towards [whatever v]
set [target v] to (direction)
point in direction (od)
The variable "target" will contain you answer.  smile

If you are paying close enough attention, you can see the frame(s) when it is rotated.

Not online. Online it runs in Single Frame, only updating at the end of loops and waits.

@lalala3 It does that in Presentation Mode too.  smile


http://i50.tinypic.com/312u714.jpg

Offline

 

Board footer