Skip to content

Commit

Permalink
added prelimiary collision detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dassschaf committed Jul 31, 2020
1 parent 0da4c1b commit 9138521
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Modes/Drift2020.Script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 241,10 @@ declare K_PlayerInfo[] G_PlayerInfo;
declare Real Speed = Player.Speed;

// crash detection
if (MathLib::Abs(Speed - G_PlayerInfo[PId]) > 15)
{
// collision!
ResetOngoingSkid(PId, S_CollisionPenalty);
}
if (MathLib::Abs(Speed - G_PlayerInfo[PId].LastTickSpeed) > 15)
ResetOngoingSkid(PId, S_CollisionPenalty); // collision!
G_PlayerInfo[PId].LastTickSpeed = Speed; // write new speed


// score relevant information
declare Real SkidAngle; //<- radians, 3.14 == 180° turned skiddderidoo
Expand Down

0 comments on commit 9138521

Please sign in to comment.