Sonic style running?

Non-platform specific questions.

Sonic style running?

Postby Qsmash » Sat Oct 27, 2007 11:29 pm

Can someone teach me how to make sonic accelerate when he's running?
Image
User avatar
Qsmash
 
Posts: 23
Joined: Sun Sep 30, 2007 2:39 am
Score: 1 Give a positive score

Re: Sonic style running?

Postby Kalladdolf » Sun Oct 28, 2007 4:28 pm

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
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: Sonic style running?

Postby Qsmash » Sun Oct 28, 2007 6:45 pm

Thanks, Now I can start on my game. :D
Image
User avatar
Qsmash
 
Posts: 23
Joined: Sun Sep 30, 2007 2:39 am
Score: 1 Give a positive score

Re: Sonic style running?

Postby Kalladdolf » Sun Oct 28, 2007 6:48 pm

I'm a sonic fan too.
in fact, I'm making a sonic game at the moment.
called: the sonic mafia :D
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron