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

#1 2012-06-09 05:00:57

boxixiong
New Scratcher
Registered: 2012-06-09
Posts: 2

Help with rotating script

Hi guys,

Is there anyway to script for a smoother rotating motion using scratch for second life?
At the moment, the rotating motion is very jolty.
I require a way of making my object rotate a certain angle in a certain amount of time.

At the moment my scratch blocks look like this

when i am touched
repeat (10)
roll (5) degrees 
wait (0.1) seconds
end
Thank you  smile

Offline

 

#2 2012-06-09 05:11:50

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Help with rotating script

If you need to rotate "d" degrees in "s" seconds, you can use this script:

when gf clicked // or whatever
set [d v] to (90) // 90 degrees
set [s v] to (3) // 3 seconds
reset timer
repeat until <(timer) > (s)>
turn ccw ((timer)*((d)/(s))) degrees
end
Also, to change the direction of rotation, you can drag out the other rotate block (with the clockwise arrow).  wink

Last edited by Hardmath123 (2012-06-09 05:12:50)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2012-06-09 06:17:02

boxixiong
New Scratcher
Registered: 2012-06-09
Posts: 2

Re: Help with rotating script

Are these in scratch for second life?

I cant seem to find them?

Offline

 

#4 2012-06-09 06:52:13

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Help with rotating script

What do you mean by second life? I can tell you where they all are though, they are all color coded. On the tab to go to their section, they have that color next to it, so use that. The orange ones are variables, you will have to make a variable before you can use those blocks.


Why are the secret organizations getting all the attention?  mad

Offline

 

#5 2012-06-09 09:28:48

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Help with rotating script

sonicfan12p wrote:

What do you mean by second life?

+1
Is it an operating system or a browser?


http://i46.tinypic.com/ao03lk.png

Offline

 

Board footer