fix acceleration for the quadrillionth time

This commit is contained in:
2026-06-17 11:41:54 -04:00
parent b5b2142a62
commit 7250e9c834
4 changed files with 12 additions and 17 deletions

View File

@@ -14,15 +14,13 @@ void UpdatePlayerControls(void)
return;
}
if(curhorvel==0.0f){
curhorvel=10.0f*scale;
curhorvel=65.5f*scale;
}
// if a key pressed, push player to the left
if (IsKeyDown(KEY_A))
{
if(curhorvel<PMV){
for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
curhorvel=curhorvel*curhorvel;
}
if(curhorvel<MAX_PLAYER_SPEED){
curhorvel=curhorvel*PLAYER_SPEED_FACTOR;
}
ApplyForce(
player,
@@ -32,10 +30,8 @@ void UpdatePlayerControls(void)
// if d key pressed, push player to the right
else if (IsKeyDown(KEY_D))
{
if(curhorvel<=PMV){
for(int i=0; i<PLAYER_SPEED_FACTOR;i++){
curhorvel=curhorvel*curhorvel;
}
if(curhorvel<=MAX_PLAYER_SPEED){
curhorvel=curhorvel*PLAYER_SPEED_FACTOR;
}
ApplyForce(
player,
@@ -43,7 +39,7 @@ void UpdatePlayerControls(void)
);
}
else{
curhorvel=10.0f*scale;
curhorvel=65.5f*scale;
}
// if sspace key pressed (and player isn't already jumping), push player
if (IsGrounded(player) &&