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:
2026-06-17 09:50:03 -04:00
parent ddd90a47de
commit 74d23adaa5

View File

@@ -20,7 +20,9 @@ void UpdatePlayerControls(void)
if (IsKeyDown(KEY_A)) if (IsKeyDown(KEY_A))
{ {
if(curhorvel<PMV){ if(curhorvel<PMV){
curhorvel=curhorvel*PLAYER_SPEED_FACTOR; for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
curhorvel=curhorvel*curhorvel;
}
} }
ApplyForce( ApplyForce(
player, player,
@@ -31,7 +33,9 @@ void UpdatePlayerControls(void)
else if (IsKeyDown(KEY_D)) else if (IsKeyDown(KEY_D))
{ {
if(curhorvel<=PMV){ if(curhorvel<=PMV){
curhorvel=curhorvel*PLAYER_SPEED_FACTOR; for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
curhorvel=curhorvel*curhorvel;
}
} }
ApplyForce( ApplyForce(
player, player,