You need to do essentially 3 checks, but doing it one way takes care of all three.
1). First set of checks is numbered collision points. You can't just count collision blocks passed, it needs to be numbered, otherwise a player can go back and forth over one collision block and then goto finish.
So at certain points around the course, you would have collision barrier 1, then 2, then 3 etc, which have to be done in order, so lets assume you have 10 collision barriers, you would have a 10 word table, and first word refers to collision barrier 1, 2nd word etc, etc, and you would only allow a lap complete if the word table was filled from start to finish in order.
So what this also does means it solves the 3 check problem.
1). Forces driver to go in order you specify
2). Means driver can't go up to collision barrier 1 and simply cross over it again and again 10 times and then go back to finish
3). Means driver can't go around course backwards and confuse your detection.
And obviously once the lap is completed, you would then add 1 to that players lap counter and then clear the word table to start again.
|