Page 1 of 1

Rotating object code

Posted: Sun Sep 05, 2021 10:19 am
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

Re: Rotating object code

Posted: Sun Sep 05, 2021 10:37 am
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