Rotating object code

What did you draw?
Post Reply
ahmedkq
Posts: 9
Joined: Sat Feb 15, 2014 5:59 am

Rotating object code

Post by ahmedkq »

Hi,
Assume I want to write the code of a more realistic solar system, how to code the angular velocity of the sun, earth, or any planet rotating around its own axis?
Thanks
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Rotating object code

Post by testtubegames »

At a certain point you'll run into issues with the fact this sim is built in 2D -- sorry Uranus. But in general if you want to give objects a rotational speed using code, it'll be input as "rotspeed: 20"... which would be 20 degrees rotation per unit time.

There's more detail about the codes here:
https://testtubegames.com/gsim101/?p=save_codes
Post Reply