Gradual turn into drift push angle

This commit is contained in:
Sryder 2017-03-07 03:00:10 +00:00
parent cac7171d48
commit 6b83d1cdc5
2 changed files with 14 additions and 13 deletions

View file

@ -1806,13 +1806,18 @@ static void K_KartDrift(player_t *player, boolean onground)
// Drifting: left or right?
if ((player->cmd.buttons & BT_DRIFTLEFT) && player->speed > (10<<16) && player->kartstuff[k_jmp] == 1
&& player->kartstuff[k_drift] < 3 && player->kartstuff[k_drift] > -1) // && player->kartstuff[k_drift] != 1)
&& player->kartstuff[k_drift] < 5 && player->kartstuff[k_drift] > -1) // && player->kartstuff[k_drift] != 1)
player->kartstuff[k_drift] = 1;
else if ((player->cmd.buttons & BT_DRIFTRIGHT) && player->speed > (10<<16) && player->kartstuff[k_jmp] == 1
&& player->kartstuff[k_drift] > -3 && player->kartstuff[k_drift] < 1) // && player->kartstuff[k_drift] != -1)
&& player->kartstuff[k_drift] > -5 && player->kartstuff[k_drift] < 1) // && player->kartstuff[k_drift] != -1)
player->kartstuff[k_drift] = -1;
else if (player->kartstuff[k_jmp] == 0) // || player->kartstuff[k_turndir] == 0)
player->kartstuff[k_drift] = 0;
{
if (player->kartstuff[k_drift] > 0)
player->kartstuff[k_drift]--;
else if (player->kartstuff[k_drift] < 0)
player->kartstuff[k_drift]++;
}
// Incease/decrease the drift value to continue drifting in that direction
if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground
@ -1823,14 +1828,14 @@ static void K_KartDrift(player_t *player, boolean onground)
if (player->kartstuff[k_drift] >= 1) // Drifting to the left
{
player->kartstuff[k_drift]++;
if (player->kartstuff[k_drift] > 3)
player->kartstuff[k_drift] = 3;
if (player->kartstuff[k_drift] > 5)
player->kartstuff[k_drift] = 5;
}
else if (player->kartstuff[k_drift] <= -1) // Drifting to the right
{
player->kartstuff[k_drift]--;
if (player->kartstuff[k_drift] < -3)
player->kartstuff[k_drift] = -3;
if (player->kartstuff[k_drift] < -5)
player->kartstuff[k_drift] = -5;
}
}

View file

@ -4590,13 +4590,9 @@ static void P_3dMovement(player_t *player)
}
else
{
if (player->kartstuff[k_drift] < 0)
if (player->kartstuff[k_drift] != 0)
{
movepushangle = player->mo->angle+ANGLE_45;
}
else if (player->kartstuff[k_drift] > 0)
{
movepushangle = player->mo->angle-ANGLE_45;
movepushangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift];
}
else
movepushangle = player->mo->angle;