mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 10:11:12 +00:00
Gradual turn into drift push angle
This commit is contained in:
parent
cac7171d48
commit
6b83d1cdc5
2 changed files with 14 additions and 13 deletions
19
src/k_kart.c
19
src/k_kart.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue