Page 1 of 1

How to make inertion?

PostPosted: Wed Mar 21, 2007 12:49 pm
by afke
I makeing car roling game and I nead to make inertion.

Car speed up step by step from speed=0 to 7 but on key up car stop .I have to make some inertion car has to slow down slowly

PostPosted: Wed Mar 21, 2007 1:03 pm
by Caaz Games
Easy! have separate key down events that have stuff like
Code: Select all
y = y - 1;
then the next one would be like
Code: Select all
y = y - 2
but on for the second key down event put "wait for frame action" use one of your animations and put 1; then the third put 2; etc.[/code]

PostPosted: Wed Mar 21, 2007 1:05 pm
by Caaz Games
then put the revers of all that on a key up event.

PostPosted: Wed Mar 21, 2007 1:24 pm
by makslane
Is better use something like this:

Code: Select all
directional_velocity *= .5;

PostPosted: Wed Mar 21, 2007 1:26 pm
by Caaz Games
:lol: Oh, i guess that could work too. :lol:

PostPosted: Wed Mar 21, 2007 2:40 pm
by afke
Thanks