Scripting Gravity

About advanced scenes, and the Thyme scripting language used in Algodoo.

Scripting Gravity

Postby tallman1996 » Thu Jul 28, 2011 8:53 pm

Is there any way to script the direction of gravity with an on collide? (Ball hits block and everything falls up) I can only find a little slider bar that says "Gravity angle offset", but I can't use that to script.
User avatar
tallman1996
 
Posts: 13
Joined: Mon Mar 22, 2010 10:16 pm

Re: Scripting Gravity

Postby TC42 » Thu Jul 28, 2011 9:02 pm

Search Grady's list of thyme variable and stuff. I'm sure it's there. If it's not, bind the gravity angle offset to an object and control the angle of the object.
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: Scripting Gravity

Postby Gear97 » Thu Jul 28, 2011 9:12 pm

The script is pretty simple.
Code: Select all
sim.gravityangleoffset = any value you want here

And the value is the angle in radians, so if you want things to fall upwards, you will need 180 degrees, wich is around 3.141592 radians. ;)
PS: 1 radian = aprox. 57,2957 degrees.
Gears are my favorite mechanism. Why do you think I have this username ? ;)
Make sure to spend some time to see my work http://www.algodoo.com/algobox/profile.php?id=96, just to kill sometime ;)
PS: Gear97™ Is a trademark from me. Any unauthorized use of the term "Gear" for usernames or other naming ideas will be punished.
User avatar
Gear97
 
Posts: 146
Joined: Sat Jan 02, 2010 5:34 pm
Location: Brazil

Re: Scripting Gravity

Postby bozbez » Thu Jul 28, 2011 10:31 pm

360 degrees is 2 pi radians.
Image

Go here. Now. That's Now. Not in 5 minutes. Now.
User avatar
bozbez
 
Posts: 149
Joined: Tue Apr 12, 2011 7:01 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests