Game Development Community

Change Gravity to X-axis

by Kiyaku · in TGB Platformer Kit · 12/21/2008 (11:06 am) · 1 replies

Hi,
is it possible to change the gravity to the x-axis and the movement to y-axis? Like you would rotate the whole scene about 90 degree.

I tried to change stuff in ActorBehaviour but i just made it messy ^^' So i wanted to check if there is a good way to change the axis.

Thanks in advance!

#1
12/21/2008 (3:02 pm)
I would recommend making the "Gravity" field an x/y vector. Where I normally add Gravity to the y-axis velocity, you would do t2dVectorAdd(%linearVelocity, %this.Gravity); instead. Then to force the actor to the right, you just set gravity to "+X 0".