tried to make acceleration even more smooth: exponential acceleration
previous version used multiplicative acceleration which did get smooth but exponential works like actual acceleration
This commit is contained in:
@@ -20,7 +20,9 @@ void UpdatePlayerControls(void)
|
||||
if (IsKeyDown(KEY_A))
|
||||
{
|
||||
if(curhorvel<PMV){
|
||||
curhorvel=curhorvel*PLAYER_SPEED_FACTOR;
|
||||
for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
|
||||
curhorvel=curhorvel*curhorvel;
|
||||
}
|
||||
}
|
||||
ApplyForce(
|
||||
player,
|
||||
@@ -31,7 +33,9 @@ void UpdatePlayerControls(void)
|
||||
else if (IsKeyDown(KEY_D))
|
||||
{
|
||||
if(curhorvel<=PMV){
|
||||
curhorvel=curhorvel*PLAYER_SPEED_FACTOR;
|
||||
for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
|
||||
curhorvel=curhorvel*curhorvel;
|
||||
}
|
||||
}
|
||||
ApplyForce(
|
||||
player,
|
||||
|
||||
Reference in New Issue
Block a user