Gravity Change

Hello,

I want to make my game horizontal, i know how to change the simulator to be vertical and horizontally but the gravity stays the same. Is there a way to change the gravity because the gravity stays to when the simulator is vertical? I tried changing the gravity but it did not work the same.

Thank you.

Ok so lets say your gravity is originality set like this.

 physics.setGravity( 0 , 9.8)

Then you would make an if statement saying if the phone is tilted. In that if statement you would
set the gravity to some other variable. Something similar to this.
 physics.setGravity( 9.8, 0)

Since you would want gravity to be going on the X axis, changing the X variable should work. You may need to make the variable to a negative depending upon direction.

Hope this helps.

Regards,
Jordan Schuetz
Ninja Pig Studios

views:1438 update:2011/9/20 17:36:54
corona forums © 2003-2011