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

#1 2012-06-08 18:50:51

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Convert Scratch direction to "normal" trig :)

I'm having a brain freeze here  sad

What to I have to do to convert from Scratch Direction (90=right,0 =up etc ) into "normal" maths (0=right,90=up etc )?

Simon
PS writing a bounce off sprite script

Offline

 

#2 2012-06-08 19:10:20

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Convert Scratch direction to "normal" trig :)

I'm not sure if there is a simple answer, if possible just use an if with the relevant equation


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-06-08 19:21:12

armor2008
Scratcher
Registered: 2011-05-18
Posts: 25

Re: Convert Scratch direction to "normal" trig :)

Subtract 90?

Offline

 

#4 2012-06-08 19:25:02

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Convert Scratch direction to "normal" trig :)

armor2008 wrote:

Subtract 90?

up becomes -90
down becomes 90
right becomes 0
left becomes -180


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#5 2012-06-08 19:28:37

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Convert Scratch direction to "normal" trig :)

Do (90 - (Scratch direction)) to get "normal" direction. 
So, pointing 90 Scratch degrees (left) is 0 normal degrees.
Pointing -90 Scratch degrees (right) is 180 normal degrees.
Pointing 0 Scratch degrees (up) is 90 normal degrees.
And pointing 180 Scratch degrees (down) is -90 normal degrees.

Offline

 

#6 2012-06-08 22:49:28

armor2008
Scratcher
Registered: 2011-05-18
Posts: 25

Re: Convert Scratch direction to "normal" trig :)

scratch converts - degrees though

Offline

 

#7 2012-06-09 03:43:11

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Convert Scratch direction to "normal" trig :)

@amcerbu - Ta  smile

I knew there must be an easy method  smile

Si

Offline

 

Board footer