fix acceleration for the quadrillionth time
This commit is contained in:
16
src/player.c
16
src/player.c
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user