Page 1 of 1

Sonic style running?

PostPosted: Sat Oct 27, 2007 11:29 pm
by Qsmash
Can someone teach me how to make sonic accelerate when he's running?

Re: Sonic style running?

PostPosted: Sun Oct 28, 2007 4:28 pm
by Kalladdolf
easy:
KeyDown->right->ScriptEditor
Code: Select all
xvelocity = xvelocity + 1.5;
if(xvelocity > 20)
{xvelocity = 20;}

KeyDown->left->ScriptEditor
Code: Select all
xvelocity = xvelocity - 1.5;
if(xvelocity < -20)
{xvelocity = -20;}


1.5 in this case is the acceleration value, 20 is the actual maximum speed.

:D

Re: Sonic style running?

PostPosted: Sun Oct 28, 2007 6:45 pm
by Qsmash
Thanks, Now I can start on my game. :D

Re: Sonic style running?

PostPosted: Sun Oct 28, 2007 6:48 pm
by Kalladdolf
I'm a sonic fan too.
in fact, I'm making a sonic game at the moment.
called: the sonic mafia :D