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 (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,
|
||||||
|
|||||||
Reference in New Issue
Block a user